Move Saxonite’s projects into a dedicated `Workspace` folder and align the solution with .NET 10 and the current Common workspace. Update encryption integration, test project structure and coverage, and repository guidance and upgrade notes. - Relocate application and library projects while retaining Git rename history. - Split tests into Admin, Online, and Shared projects; add representative behavioral and serialization tests. - Update Common integration, application version, and repository documentation. Application version: 1.3.0 Reviewed-on: #1 Co-authored-by: andy <andy@sarand.com>
48 lines
1.8 KiB
C#
48 lines
1.8 KiB
C#
using NUnit.Framework;
|
|
using Saxonite.Net.Standard.Base.App;
|
|
using Saxonite.Net.Standard.Base.Bus;
|
|
using System;
|
|
|
|
namespace Saxonite.Net.Core.UnitTests.Data.Bus
|
|
{
|
|
//=======================================================================
|
|
[TestFixture]
|
|
public class SaxEligibilityAndEventRules_Tester
|
|
{
|
|
//-------------------------------------------------------------------
|
|
[TestCase(Sax.EligibilityType.Birth, 1)]
|
|
[TestCase(Sax.EligibilityType.Naturalised, 1)]
|
|
[TestCase(Sax.EligibilityType.Parent, 2)]
|
|
[TestCase(Sax.EligibilityType.Grandparent, 4)]
|
|
[TestCase(Sax.EligibilityType.Passport, 9)]
|
|
[TestCase(Sax.EligibilityType.Visa, 9)]
|
|
[TestCase(Sax.EligibilityType.Unknown, 9)]
|
|
public void EligibilityTypeHasExpectedInstanceLimit(Sax.EligibilityType type, int expected)
|
|
{
|
|
Assert.That(SaxUserEligibility.GetMaxInstances(type), Is.EqualTo(expected));
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
[TestCase(Sax.EligibilityType.Birth, false)]
|
|
[TestCase(Sax.EligibilityType.Parent, false)]
|
|
[TestCase(Sax.EligibilityType.Passport, true)]
|
|
[TestCase(Sax.EligibilityType.Visa, true)]
|
|
[TestCase(Sax.EligibilityType.Unknown, false)]
|
|
public void ApplicablePeriodIsLimitedToPassportAndVisa(Sax.EligibilityType type, bool expected)
|
|
{
|
|
Assert.That(SaxUserEligibility.AllowsApplicablePeriod(type), Is.EqualTo(expected));
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
[TestCase(null, false)]
|
|
[TestCase("2026-10-16T00:00:00", false)]
|
|
[TestCase("2026-10-16T00:01:00", true)]
|
|
[TestCase("2026-10-16T12:30:00", true)]
|
|
public void EventTimeRejectsMissingAndExactMidnight(DateTime? eventAt, bool expected)
|
|
{
|
|
Assert.That(SaxOrganisationEvent.HasValidEventTime(eventAt), Is.EqualTo(expected));
|
|
}
|
|
}
|
|
//=======================================================================
|
|
}
|