Mercurial > repos > IBDev-IBBoard.WarFoundry.API.Tests
diff 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 |
line wrap: on
line diff
--- a/API/Factories/Xml/WarFoundryXmlFactoryTests.cs Sat Feb 26 20:15:38 2011 +0000 +++ b/API/Factories/Xml/WarFoundryXmlFactoryTests.cs Sun Feb 27 19:44:08 2011 +0000 @@ -13,7 +13,11 @@ [Test()] public void TestFactoryHandlesMultipleFilesWithOldNamesInOneSystemZip() { - ICollection<IWarFoundryObject> objs = WarFoundryXmlFactory.GetFactory().CreateObjectsFromFile(new FileInfo("testdata/multifile-zips/Test.system")); + EventListeningWarFoundryLoader loader = new EventListeningWarFoundryLoader (); + WarFoundryLoader.SetDefault(loader); + WarFoundryXmlFactory factory = WarFoundryXmlFactory.GetFactory (); + loader.RegisterFactory(factory); + ICollection<IWarFoundryObject> objs = factory.CreateObjectsFromFile(new FileInfo("testdata/multifile-zips/Test.system")); Assert.That(objs, Has.Count(2)); int raceCount = 0; int systemCount = 0;