Mercurial > repos > IBBoard.WarFoundry.API.Tests
diff API/Factories/Xml/WarFoundryXmlRaceFactoryTest.cs @ 72:d1d79adcb11d
Re #297: Move Categories over to key/keyref from ID/IDREF
* Add unit tests for races with category overrides
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Wed, 21 Jul 2010 20:28:28 +0000 |
parents | f671ead260b1 |
children | 102887bd063b |
line wrap: on
line diff
--- a/API/Factories/Xml/WarFoundryXmlRaceFactoryTest.cs Wed Jul 07 19:01:32 2010 +0000 +++ b/API/Factories/Xml/WarFoundryXmlRaceFactoryTest.cs Wed Jul 21 20:28:28 2010 +0000 @@ -327,6 +327,20 @@ Assert.That(unitTypesCat2, Is.All.EqualTo(unitType)); } + [Test()] + public void TestValidCategoriesLoadsCorrectly() + { + SetDefaultGameSystem(); + Race race = SingleXmlObjectLoader.LoadRaceFromXML(WarFoundryXmlFactory.GetFactory(), new FileInfo("testdata/xml-race-factory/valid-categories.racex")); + Assert.That(race.Categories, Has.Length(5)); + } + + [Test()] + public void TestDuplicateCategoryIDErrors() + { + TestFileValidationFailure("testdata/xml-race-factory/duplicate-category-ids.racex"); + } + private void TestFileValidationFailure(string filePath) { SetDefaultGameSystem();