Mercurial > repos > IBBoard.WarFoundry.API.Tests
comparison API/Factories/Xml/WarFoundryXmlFactoryTests.cs @ 89:90dee8d781ee
Re #253: Allow multiple data files in a single zip
* Add and use loader that just listens to events to capture new objects and does nothing else
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 27 Feb 2011 19:44:08 +0000 |
parents | 5c04db41d643 |
children | 5d19fee8e9dc |
comparison
equal
deleted
inserted
replaced
88:31fd34f7d7cf | 89:90dee8d781ee |
---|---|
11 public class WarFoundryXmlFactoryTests | 11 public class WarFoundryXmlFactoryTests |
12 { | 12 { |
13 [Test()] | 13 [Test()] |
14 public void TestFactoryHandlesMultipleFilesWithOldNamesInOneSystemZip() | 14 public void TestFactoryHandlesMultipleFilesWithOldNamesInOneSystemZip() |
15 { | 15 { |
16 ICollection<IWarFoundryObject> objs = WarFoundryXmlFactory.GetFactory().CreateObjectsFromFile(new FileInfo("testdata/multifile-zips/Test.system")); | 16 EventListeningWarFoundryLoader loader = new EventListeningWarFoundryLoader (); |
17 WarFoundryLoader.SetDefault(loader); | |
18 WarFoundryXmlFactory factory = WarFoundryXmlFactory.GetFactory (); | |
19 loader.RegisterFactory(factory); | |
20 ICollection<IWarFoundryObject> objs = factory.CreateObjectsFromFile(new FileInfo("testdata/multifile-zips/Test.system")); | |
17 Assert.That(objs, Has.Count(2)); | 21 Assert.That(objs, Has.Count(2)); |
18 int raceCount = 0; | 22 int raceCount = 0; |
19 int systemCount = 0; | 23 int systemCount = 0; |
20 | 24 |
21 foreach (IWarFoundryObject obj in objs) | 25 foreach (IWarFoundryObject obj in objs) |