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 parentTypes = SaxRegion.GetValidParentRegionTypes(Sax.RegionType.Country); parentTypes.Clear(); Assert.That(SaxRegion.GetValidParentRegionTypes(Sax.RegionType.Country), Is.EquivalentTo(new[] { Sax.RegionType.Continent, Sax.RegionType.SubContinent })); } } //======================================================================= }