Mercurial > repos > IBBoard.WarFoundry.API.Tests
comparison 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 |
comparison
equal
deleted
inserted
replaced
146:8c519a44e699 | 147:1de37b5c8107 |
---|---|
337 | 337 |
338 [Test()] | 338 [Test()] |
339 public void TestDuplicateCategoryIDErrors() | 339 public void TestDuplicateCategoryIDErrors() |
340 { | 340 { |
341 TestFileValidationFailure("testdata/xml-race-factory/duplicate-category-ids.racex"); | 341 TestFileValidationFailure("testdata/xml-race-factory/duplicate-category-ids.racex"); |
342 } | |
343 | |
344 [Test()] | |
345 public void TestExtendedRequirementsPassValidation() | |
346 { | |
347 SetDefaultGameSystem(); | |
348 Race race = SingleXmlObjectLoader.LoadRaceFromXML(WarFoundryXmlFactory.GetFactory(), new FileInfo("testdata/xml-race-factory/extended-requirements.racex")); | |
349 Assert.That(race.Categories, Has.Length(5)); | |
350 } | |
351 | |
352 [Test()] | |
353 public void TestLoadingSimpleRequirement() | |
354 { | |
355 SetDefaultGameSystem(); | |
356 Race race = SingleXmlObjectLoader.LoadRaceFromXML(WarFoundryXmlFactory.GetFactory(), new FileInfo("testdata/xml-race-factory/simple-requirement.racex")); | |
357 UnitType unitType = race.GetUnitType("Empire1"); | |
358 Assert.That(unitType.GetRequirements(), Has.Length(1)); | |
342 } | 359 } |
343 | 360 |
344 private void TestFileValidationFailure(string filePath) | 361 private void TestFileValidationFailure(string filePath) |
345 { | 362 { |
346 SetDefaultGameSystem(); | 363 SetDefaultGameSystem(); |