ef2fd39508
Backend CI / build-and-test (push) Successful in 48s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 5s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 24s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Failing after 14s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 2s
30 lines
813 B
C#
30 lines
813 B
C#
using UniVerse.Domain.Services;
|
|
using Xunit;
|
|
|
|
namespace UniVerse.Api.Tests.DomainServices;
|
|
|
|
public class EnrollmentSlotPolicyTests
|
|
{
|
|
[Theory]
|
|
[InlineData(-1, 3)]
|
|
[InlineData(0, 3)]
|
|
[InlineData(1, 3)]
|
|
[InlineData(2, 3)]
|
|
[InlineData(3, 5)]
|
|
[InlineData(4, 7)]
|
|
[InlineData(10, 7)]
|
|
public void GetLimitForLevel_UsesHighestMatchingRuleOrDefault(int level, int expectedSlots)
|
|
{
|
|
var slots = EnrollmentSlotPolicy.GetLimitForLevel(level);
|
|
|
|
Assert.Equal(expectedSlots, slots);
|
|
}
|
|
|
|
[Fact]
|
|
public void Rules_ExposeConfiguredThresholdsInAscendingOrder()
|
|
{
|
|
Assert.Equal(new[] { 1, 3, 4 }, EnrollmentSlotPolicy.Rules.Select(rule => rule.Level));
|
|
Assert.Equal(new[] { 3, 5, 7 }, EnrollmentSlotPolicy.Rules.Select(rule => rule.Slots));
|
|
}
|
|
}
|