Mercurial > repos > IBBoard.WarFoundry.API.Tests
comparison API/Factories/Xml/WarFoundryXmlRaceFactoryTest.cs @ 228:7c21ca1482cb
Re #419: Remove assumptions of a file-based install
* Update tests to use new "loadable object" and "loadable object source" wrappers
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 07 Jul 2012 21:02:53 +0100 |
parents | c6313a2c08a2 |
children | 833f72be715a |
comparison
equal
deleted
inserted
replaced
227:d8cd6b259a9f | 228:7c21ca1482cb |
---|---|
10 using IBBoard.WarFoundry.API.Objects; | 10 using IBBoard.WarFoundry.API.Objects; |
11 using NUnit.Framework; | 11 using NUnit.Framework; |
12 using NUnit.Framework.SyntaxHelpers; | 12 using NUnit.Framework.SyntaxHelpers; |
13 using IBBoard.WarFoundry.API.Objects.Requirement; | 13 using IBBoard.WarFoundry.API.Objects.Requirement; |
14 using IBBoard.WarFoundry.API.Factories.Requirement; | 14 using IBBoard.WarFoundry.API.Factories.Requirement; |
15 using IBBoard.WarFoundry.API.Loading; | |
15 | 16 |
16 namespace IBBoard.WarFoundry.API.Factories.Xml | 17 namespace IBBoard.WarFoundry.API.Factories.Xml |
17 { | 18 { |
18 //It would be better to explicitly check that some of these errors are certain types of schema validation error, but Mono and .Net have | 19 //It would be better to explicitly check that some of these errors are certain types of schema validation error, but Mono and .Net have |
19 //different exception messages for the same text and just have one class for all schema exceptions of all types. | 20 //different exception messages for the same text and just have one class for all schema exceptions of all types. |
165 | 166 |
166 [Test()] | 167 [Test()] |
167 [ExpectedException(typeof(InvalidFileException), ExpectedMessage="Referenced game system, 'nonexistant-system', did not exist")] | 168 [ExpectedException(typeof(InvalidFileException), ExpectedMessage="Referenced game system, 'nonexistant-system', did not exist")] |
168 public void TestCompleteLoadingOnRaceWithMissingGameSystemErrors() | 169 public void TestCompleteLoadingOnRaceWithMissingGameSystemErrors() |
169 { | 170 { |
170 ICollection<IWarFoundryObject> objs = WarFoundryXmlFactory.GetFactory().CreateObjectsFromFile(new FileInfo("testdata/race-with-non-existant-game-system.race")); | 171 ICollection<IWarFoundryObject> objs = WarFoundryXmlFactory.GetFactory().CreateObjectsFromFile(new LoadableFileObject(new FileInfo("testdata/race-with-non-existant-game-system.race"))); |
171 Assert.AreEqual(1, objs.Count); | 172 Assert.AreEqual(1, objs.Count); |
172 IEnumerator<IWarFoundryObject> enumerator = objs.GetEnumerator(); | 173 IEnumerator<IWarFoundryObject> enumerator = objs.GetEnumerator(); |
173 enumerator.Reset(); | 174 enumerator.Reset(); |
174 enumerator.MoveNext(); | 175 enumerator.MoveNext(); |
175 Race race = (Race)enumerator.Current; | 176 Race race = (Race)enumerator.Current; |