Files
Saxonite/Workspace/SaxoniteUnitTestsShared/UnitTests/Data/Bus/SaxRegion_Bus_Tester.cs
T
andy 9f22b522df v1.3.0 Restructure Saxonite workspace and upgrade to .NET 10 (#1)
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>
2026-10-16 18:24:16 +01:00

37 lines
1.5 KiB
C#

using NUnit.Framework;
using Saxonite.Net.Standard.Base.App;
using Saxonite.Net.Standard.Base.Bus;
using System.Collections.Generic;
namespace Saxonite.Net.Core.UnitTests.Data.Bus
{
//=======================================================================
[TestFixture]
public class SaxRegion_Bus_Tester
{
//-------------------------------------------------------------------
[TestCase(Sax.RegionType.World, Sax.RegionType.Galaxy, true)]
[TestCase(Sax.RegionType.Continent, Sax.RegionType.World, true)]
[TestCase(Sax.RegionType.Country, Sax.RegionType.SubContinent, true)]
[TestCase(Sax.RegionType.Province, Sax.RegionType.Nation, true)]
[TestCase(Sax.RegionType.Province, Sax.RegionType.State, false)]
[TestCase(Sax.RegionType.Unknown, Sax.RegionType.World, false)]
public void IsValidParentRegionType_ReflectsRegionHierarchy(Sax.RegionType regionType, Sax.RegionType parentType, bool expected)
{
Assert.That(SaxRegion.IsValidParentRegionType(regionType, parentType), Is.EqualTo(expected));
}
//-------------------------------------------------------------------
[Test]
public void GetValidParentRegionTypes_ReturnsAnIndependentList()
{
List<Sax.RegionType> parentTypes = SaxRegion.GetValidParentRegionTypes(Sax.RegionType.Country);
parentTypes.Clear();
Assert.That(SaxRegion.GetValidParentRegionTypes(Sax.RegionType.Country),
Is.EquivalentTo(new[] { Sax.RegionType.Continent, Sax.RegionType.SubContinent }));
}
}
//=======================================================================
}