Mercurial > repos > IBDev-IBBoard.WarFoundry.API.Tests
comparison API/Factories/Mock/MockSystemFactory.cs @ 12:a4e7e938d065
Re #195: Setting max equipment without min may not function correctly
* Initial commit of tests for limits (percentage and numeric)
Also:
* Reshuffle and refactoring of existing tests
* Additional mocks required by the new tests
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 12 Oct 2009 19:42:30 +0000 |
parents | |
children | 31fd34f7d7cf |
comparison
equal
deleted
inserted
replaced
11:8d9d49332d44 | 12:a4e7e938d065 |
---|---|
1 // This file (MockSystemFactory.cs) is a part of the IBBoard.WarFoundry.API.Tests project and is copyright 2008, 2009 IBBoard. | |
2 // | |
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. | |
4 | |
5 using System; | |
6 using System.IO; | |
7 using IBBoard.WarFoundry.API.Factories; | |
8 using IBBoard.WarFoundry.API.Objects; | |
9 using ICSharpCode.SharpZipLib.Zip; | |
10 | |
11 namespace IBBoard.WarFoundry.API.Factories.Mock | |
12 { | |
13 public class MockSystemFactory : AbstractNativeWarFoundryFactory | |
14 { | |
15 private static MockSystemFactory mock; | |
16 | |
17 public static MockSystemFactory GetMockFactory() | |
18 { | |
19 if (mock == null) | |
20 { | |
21 mock = new MockSystemFactory(); | |
22 } | |
23 | |
24 return mock; | |
25 } | |
26 | |
27 public MockSystemFactory() | |
28 { | |
29 } | |
30 | |
31 protected override bool CheckCanFindArmyFileContent(ZipFile file) | |
32 { | |
33 return false; | |
34 } | |
35 | |
36 protected override bool CheckCanFindRaceFileContent(ZipFile file) | |
37 { | |
38 return false; | |
39 } | |
40 | |
41 protected override bool CheckCanFindSystemFileContent(ZipFile file) | |
42 { | |
43 return true; | |
44 } | |
45 | |
46 protected override Army CreateArmyFromStream (ZipFile file, Stream dataStream) | |
47 { | |
48 throw new NotImplementedException (); | |
49 } | |
50 | |
51 protected override GameSystem CreateGameSystemFromStream (ZipFile file, Stream dataStream) | |
52 { | |
53 return new GameSystem("test", "Test System", this); | |
54 } | |
55 | |
56 protected override Race CreateRaceFromStream (ZipFile file, Stream dataStream) | |
57 { | |
58 throw new NotImplementedException (); | |
59 } | |
60 | |
61 protected override Stream GetArmyDataStream (ZipFile file) | |
62 { | |
63 throw new NotImplementedException (); | |
64 } | |
65 | |
66 protected override Stream GetGameSystemDataStream (ZipFile file) | |
67 { | |
68 return new MemoryStream(); | |
69 } | |
70 | |
71 protected override Stream GetRaceDataStream (ZipFile file) | |
72 { | |
73 throw new NotImplementedException (); | |
74 } | |
75 } | |
76 } |