Mercurial > repos > IBDev-IBBoard.WarFoundry.API.Tests
comparison API/Factories/Mock/MockRaceFactory.cs @ 155:3725fd449c77
Re #353: Handle unloaded units being referenced outside factory
* Add mock factory and use it in tests
All tests now pass (including tests that started failing because of unit loading order - triggered by requirement changes)
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 04 Jul 2011 20:03:47 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
154:bf2880cf7bc5 | 155:3725fd449c77 |
---|---|
1 // This file (MockRaceFactory.cs) is a part of the IBBoard.WarFoundry.API.Tests project and is copyright 2011 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 using System; | |
5 using IBBoard.WarFoundry.API.Objects; | |
6 | |
7 namespace IBBoard.WarFoundry.API.Factories.Mock | |
8 { | |
9 public class MockRaceFactory : IRaceFactory<object, object> | |
10 { | |
11 public MockRaceFactory() | |
12 { | |
13 //Do nothing special | |
14 } | |
15 | |
16 public Race CreateRace (object entry) | |
17 { | |
18 throw new NotImplementedException (); | |
19 } | |
20 | |
21 public void CompleteLoading (Race race) | |
22 { | |
23 //Do nothing | |
24 } | |
25 | |
26 public UnitType GetUnitType (string id, Race parentRace) | |
27 { | |
28 return parentRace.GetUnitType(id); | |
29 } | |
30 | |
31 public UnitType GetUnitType (string id, Race parentRace, object src) | |
32 { | |
33 return parentRace.GetUnitType(id); | |
34 } | |
35 } | |
36 } | |
37 |