# HG changeset patch # User IBBoard # Date 1298751269 0 # Node ID 5c04db41d64321fcf0c4c2640c91fbba8975e2d9 # Parent d1ec7618f812943292632773ee8ebe9a74471a41 Re #253: Allow multiple data files in a single zip * Add test data and initial test diff -r d1ec7618f812 -r 5c04db41d643 API/Factories/Xml/WarFoundryXmlFactoryTests.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/API/Factories/Xml/WarFoundryXmlFactoryTests.cs Sat Feb 26 20:14:29 2011 +0000 @@ -0,0 +1,37 @@ +using System; +using NUnit.Framework; +using System.IO; +using System.Collections.Generic; +using IBBoard.WarFoundry.API.Objects; +using NUnit.Framework.SyntaxHelpers; + +namespace IBBoard.WarFoundry.API.Factories.Xml +{ + [TestFixture()] + public class WarFoundryXmlFactoryTests + { + [Test()] + public void TestFactoryHandlesMultipleFilesWithOldNamesInOneSystemZip() + { + ICollection objs = WarFoundryXmlFactory.GetFactory().CreateObjectsFromFile(new FileInfo("testdata/multifile-zips/Test.system")); + Assert.That(objs, Has.Count(2)); + int raceCount = 0; + int systemCount = 0; + + foreach (IWarFoundryObject obj in objs) + { + if (obj is Race) + { + raceCount++; + } + else if (obj is GameSystem) + { + systemCount++; + } + } + + Assert.That(raceCount, Is.EqualTo(1)); + Assert.That(systemCount, Is.EqualTo(1)); + } + } +} diff -r d1ec7618f812 -r 5c04db41d643 IBBoard.WarFoundry.API.Tests.csproj --- a/IBBoard.WarFoundry.API.Tests.csproj Wed Feb 23 20:37:59 2011 +0000 +++ b/IBBoard.WarFoundry.API.Tests.csproj Sat Feb 26 20:14:29 2011 +0000 @@ -1,5 +1,5 @@ - - + + Debug AnyCPU @@ -88,6 +88,7 @@ + @@ -264,6 +265,15 @@ false PreserveNewest + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + @@ -325,4 +335,7 @@ true + + + \ No newline at end of file diff -r d1ec7618f812 -r 5c04db41d643 testdata/multifile-zips/Multipack.system Binary file testdata/multifile-zips/Multipack.system has changed diff -r d1ec7618f812 -r 5c04db41d643 testdata/multifile-zips/Test.race Binary file testdata/multifile-zips/Test.race has changed diff -r d1ec7618f812 -r 5c04db41d643 testdata/multifile-zips/Test.system Binary file testdata/multifile-zips/Test.system has changed