Mercurial > repos > IBBoard.WarFoundry.API.Tests
annotate API/WarFoundryLoaderTest.cs @ 55:7f9e1fef069e
Re #279: Create composite limit
* Create separate tests for min and max limits (rename existing test data file)
* Fix namespacing of limit nodes
* Add test for nesting of composite limits
* Add tests for empty composite causing failure
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 05 Jun 2010 18:58:54 +0000 |
parents | 4302e6b2c5c1 |
children | d1ec7618f812 |
rev | line source |
---|---|
11 | 1 // This file (WarFoundryLoaderTest.cs) is a part of the IBBoard.WarFoundry.API.Tests project and is copyright 2008, 2009 IBBoard. |
0 | 2 // |
11 | 3 // The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. |
0 | 4 |
5 using System; | |
6 using System.IO; | |
7 using NUnit.Framework; | |
12
a4e7e938d065
Re #195: Setting max equipment without min may not function correctly
IBBoard <dev@ibboard.co.uk>
parents:
11
diff
changeset
|
8 using IBBoard.WarFoundry.API.Factories.Mock; |
0 | 9 using IBBoard.WarFoundry.API.Objects; |
10 | |
11 namespace IBBoard.WarFoundry.API.Factories | |
12 { | |
13 [TestFixture()] | |
14 public class WarFoundryLoaderTest | |
15 { | |
9 | 16 private AbstractNativeWarFoundryFactory sysFactory; |
0 | 17 |
18 [Test()] | |
19 public void TestLoadWithoutFactoriesCompletesWithoutError() | |
20 { | |
21 WarFoundryLoader.GetDefault().LoadFiles(); | |
22 } | |
23 | |
24 [Test()] | |
25 public void TestLoadingSystemCompletesWithoutError() | |
26 { | |
35
4302e6b2c5c1
Re #228: Crash with missing abilityID
IBBoard <dev@ibboard.co.uk>
parents:
12
diff
changeset
|
27 AbstractWarFoundryLoader loader = WarFoundryLoader.GetDefault(); |
9 | 28 DirectoryInfo dir = new DirectoryInfo("testdata"); |
29 loader.RegisterFactory(GetSystemFactory()); | |
0 | 30 loader.AddLoadDirectory(dir); |
31 loader.LoadFiles(); | |
32 Assert.Greater(loader.GetGameSystems().Length, 0); | |
33 loader.RemoveLoadDirectory(dir); | |
9 | 34 loader.UnregisterFactory(GetSystemFactory()); |
0 | 35 } |
36 | |
9 | 37 private AbstractNativeWarFoundryFactory GetSystemFactory() |
0 | 38 { |
9 | 39 if (sysFactory == null) |
0 | 40 { |
9 | 41 sysFactory = new MockSystemFactory(); |
0 | 42 } |
43 | |
9 | 44 return sysFactory; |
0 | 45 } |
46 } | |
47 } |