diff API/WarFoundryLoaderTest.cs @ 86:d1ec7618f812

Fixes #318: DefaultWarFoundryLoader throws null ref when loading individual files * Add unit test for loading a single file
author IBBoard <dev@ibboard.co.uk>
date Wed, 23 Feb 2011 20:37:59 +0000
parents 4302e6b2c5c1
children 17c5030485dc
line wrap: on
line diff
--- a/API/WarFoundryLoaderTest.cs	Sun Feb 20 20:43:50 2011 +0000
+++ b/API/WarFoundryLoaderTest.cs	Wed Feb 23 20:37:59 2011 +0000
@@ -7,6 +7,9 @@
 using NUnit.Framework;
 using IBBoard.WarFoundry.API.Factories.Mock;
 using IBBoard.WarFoundry.API.Objects;
+using NUnit.Framework.SyntaxHelpers;
+using System.Collections.Generic;
+using IBBoard.WarFoundry.API.Factories.Xml;
 
 namespace IBBoard.WarFoundry.API.Factories
 {
@@ -33,6 +36,15 @@
 			loader.RemoveLoadDirectory(dir);
 			loader.UnregisterFactory(GetSystemFactory());
 		}
+		
+		[Test()]
+		public void TestBug318LoadingSingleFileShouldNotNullRef()
+		{
+			DefaultWarFoundryLoader loader = new DefaultWarFoundryLoader();
+			loader.RegisterFactory(WarFoundryXmlFactory.GetFactory());
+			ICollection<IWarFoundryObject> objs = loader.LoadFile(new FileInfo("testdata/Test.system"));
+			Assert.That(objs, Has.Count(1));
+		}
 				
 		private AbstractNativeWarFoundryFactory GetSystemFactory()
 		{