From 93a413178b61271e3e71833e6d103c03176c9e38 Mon Sep 17 00:00:00 2001 From: Alexandre Leonardi Date: Fri, 16 Jan 2015 23:50:32 +0100 Subject: [PATCH] tests --- SCvUnitTest/GameBuilderTest.cs | 2 +- SCvUnitTest/GameTests.cs | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/SCvUnitTest/GameBuilderTest.cs b/SCvUnitTest/GameBuilderTest.cs index 6bf1e66..c4e7d3c 100644 --- a/SCvUnitTest/GameBuilderTest.cs +++ b/SCvUnitTest/GameBuilderTest.cs @@ -12,7 +12,7 @@ void TestNew(){ IPlayer p1 = new Player {Faction = FactionType.Elves, Name = "A", Score = 0}; IPlayer p2 = new Player {Faction = FactionType.Dwarves, Name = "B", Score = 0}; IPlayer p3 = new Player {Faction = FactionType.Orcs, Name = "C", Score = 0}; - IGame g = GameBuilder.New(MapType.Demo, p1, p2); + IGame g = GameBuilder.New(MapType.Demo, (Player)p1, (Player)p2); Assert.AreEqual(g.Map.Width, 6); Assert.AreEqual(g.Map.Turns, 5); diff --git a/SCvUnitTest/GameTests.cs b/SCvUnitTest/GameTests.cs index b4bfad7..61f8610 100644 --- a/SCvUnitTest/GameTests.cs +++ b/SCvUnitTest/GameTests.cs @@ -16,17 +16,20 @@ public void TestGameCreation() Assert.AreEqual(Game.Instance, game); } - /*[TestMethod] + [TestMethod] public void TestNextTurn() { - Game game = new Game(); + IPlayer p1 = new Player { Faction = FactionType.Elves, Name = "A", Score = 0 }; + IPlayer p2 = new Player { Faction = FactionType.Dwarves, Name = "B", Score = 0 }; + IGame game = GameBuilder.New(MapType.Demo, (Player)p1, (Player)p2); + game.NextTurn(); Assert.AreEqual(game.CurrentPlayerId, 1); Assert.AreEqual(game.Turn,0); game.NextTurn(); - Assert.AreEqual(game.CurrentPlayerId, 1); + Assert.AreEqual(game.CurrentPlayerId, 0); Assert.AreEqual(game.Turn, 1); - }*/ + } /* [TestMethod] public void TestCalculateUnitStats() @@ -34,10 +37,12 @@ public void TestCalculateUnitStats() Game game = new Game(); }*/ - /*[TestMethod] + /* [TestMethod] public void TestIsEnded() { - + IPlayer p1 = new Player { Faction = FactionType.Elves, Name = "A", Score = 0 }; + IPlayer p2 = new Player { Faction = FactionType.Dwarves, Name = "B", Score = 0 }; + IGame game = GameBuilder.New(MapType.Demo, (Player)p1, (Player)p2); }*/ } }