102
|
1 // This file (UnitRequiresAtLeastNUnitsRequirement.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 NUnit.Framework;
|
|
6 using IBBoard.WarFoundry.API.Objects.Mock;
|
|
7 using NUnit.Framework.SyntaxHelpers;
|
|
8
|
|
9 namespace IBBoard.WarFoundry.API.Objects.Requirements
|
|
10 {
|
|
11 [TestFixture()]
|
|
12 public class UnitRequiresAtLeastNUnitsRequirementTest
|
|
13 {
|
|
14 [Test()]
|
|
15 public void TestWithNoUnits()
|
|
16 {
|
|
17 MockRace mockRace = MockRace.GetMockRace();
|
|
18 UnitType unitType1 = new MockUnitType("type1", "Unit Type 1");
|
|
19 mockRace.AddUnitType(unitType1);
|
|
20 UnitType unitType2 = new MockUnitType("type2", "Unit Type 2");
|
|
21 mockRace.AddUnitType(unitType2);
|
|
22 Army army = new Army(mockRace, "Test", 1000);
|
|
23 UnitRequiresAtLeastNUnitsRequirement req = new UnitRequiresAtLeastNUnitsRequirement(unitType1, unitType2);
|
|
24 Unit unit = new Unit(unitType1, army.GetCategory(unitType1.MainCategory));
|
|
25 Assert.That(req.CanAddToArmy(unit, army), Is.False);
|
|
26 }
|
|
27 }
|
|
28 }
|
|
29
|