# HG changeset patch # User IBBoard # Date 1476646175 -3600 # Node ID 370bec16a364acdddf42d8d613add74786b3687d # Parent e173c551206763745dfc203cdd9b2b48fe1ae2e9 Add initial testing for equipment with type (incomplete) diff -r e173c5512067 -r 370bec16a364 API/Factories/Xml/WarFoundryXmlRaceFactoryTest.cs --- a/API/Factories/Xml/WarFoundryXmlRaceFactoryTest.cs Sun Apr 28 19:32:38 2013 +0100 +++ b/API/Factories/Xml/WarFoundryXmlRaceFactoryTest.cs Sun Oct 16 20:29:35 2016 +0100 @@ -408,6 +408,16 @@ Assert.That(race.GetUnitTypes(race.GetCategory("cat1")), Has.Member(unitType3)); } + [Test] + public void TestEquipmentTypeLoading() + { + SetDefaultGameSystem(); + Race race = SingleXmlObjectLoader.LoadRaceFromXML(WarFoundryXmlFactory.GetFactory(), new FileInfo("testdata/equipment-groups/equipment-with-type.racex")); + UnitType unitType = race.GetUnitType("Empire1"); + Assert.That(unitType, Is.Not.Null); + //TODO: Finish testing + } + private void TestFileValidationFailure(string filePath) { SetDefaultGameSystem(); diff -r e173c5512067 -r 370bec16a364 API/Factories/Xml/WarFoundryXmlSystemFactoryTest.cs --- a/API/Factories/Xml/WarFoundryXmlSystemFactoryTest.cs Sun Apr 28 19:32:38 2013 +0100 +++ b/API/Factories/Xml/WarFoundryXmlSystemFactoryTest.cs Sun Oct 16 20:29:35 2016 +0100 @@ -95,6 +95,13 @@ Assert.That(system.SystemPtsNameSingle, Is.EqualTo("point")); } + [Test] + public void TestLoadingEquipmentCategories() + { + GameSystem system = SingleXmlObjectLoader.LoadGameSystemFromXML(WarFoundryXmlFactory.GetFactory(), new FileInfo("testdata/default.systemx")); + Assert.That(system.EquipmentCategories, Is.EquivalentTo(new EquipmentCategory[]{new EquipmentCategory("equip1", "Weapons"), new EquipmentCategory("equip2", "Armour")})); + } + private void TestFileValidationFailure(string filePath) { FileInfo systemFile = new FileInfo(filePath); diff -r e173c5512067 -r 370bec16a364 IBBoard.WarFoundry.API.Tests.csproj --- a/IBBoard.WarFoundry.API.Tests.csproj Sun Apr 28 19:32:38 2013 +0100 +++ b/IBBoard.WarFoundry.API.Tests.csproj Sun Oct 16 20:29:35 2016 +0100 @@ -336,6 +336,9 @@ PreserveNewest + + PreserveNewest + @@ -410,6 +413,7 @@ + diff -r e173c5512067 -r 370bec16a364 testdata/default.systemx --- a/testdata/default.systemx Sun Apr 28 19:32:38 2013 +0100 +++ b/testdata/default.systemx Sun Oct 16 20:29:35 2016 +0100 @@ -20,4 +20,8 @@ + + + + diff -r e173c5512067 -r 370bec16a364 testdata/equipment-groups/equipment-with-type.racex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/testdata/equipment-groups/equipment-with-type.racex Sun Oct 16 20:29:35 2016 +0100 @@ -0,0 +1,26 @@ + + + + + + 4 + 6 + 6 + 4 + 4 + 3 + 6 + 4 + 9 + + + + + + + + + + + + \ No newline at end of file