diff API/Factories/Xml/WarFoundryXmlRaceFactoryTest.cs @ 147:1de37b5c8107

Re #346: Add core schema support for requirements * Test schema support for requirements (currently fails)
author IBBoard <dev@ibboard.co.uk>
date Sat, 28 May 2011 16:04:27 +0000
parents 102887bd063b
children 71b9364f0276
line wrap: on
line diff
--- a/API/Factories/Xml/WarFoundryXmlRaceFactoryTest.cs	Sun May 01 19:17:11 2011 +0000
+++ b/API/Factories/Xml/WarFoundryXmlRaceFactoryTest.cs	Sat May 28 16:04:27 2011 +0000
@@ -341,6 +341,23 @@
 			TestFileValidationFailure("testdata/xml-race-factory/duplicate-category-ids.racex");
 		}
 
+		[Test()]
+		public void TestExtendedRequirementsPassValidation()
+		{
+			SetDefaultGameSystem();
+			Race race = SingleXmlObjectLoader.LoadRaceFromXML(WarFoundryXmlFactory.GetFactory(), new FileInfo("testdata/xml-race-factory/extended-requirements.racex"));
+			Assert.That(race.Categories, Has.Length(5));
+		}
+
+		[Test()]
+		public void TestLoadingSimpleRequirement()
+		{
+			SetDefaultGameSystem();
+			Race race = SingleXmlObjectLoader.LoadRaceFromXML(WarFoundryXmlFactory.GetFactory(), new FileInfo("testdata/xml-race-factory/simple-requirement.racex"));
+			UnitType unitType = race.GetUnitType("Empire1");
+			Assert.That(unitType.GetRequirements(), Has.Length(1));
+		}
+
 		private void TestFileValidationFailure(string filePath)
 		{
 			SetDefaultGameSystem();