public void TestDoubleParsingPlayer3() { Player p1 = RM.RandomPlayer(0, 50); Player p2 = p1.Stringify().ParseToPlayer().Stringify().ParseToPlayer(); Assert.IsTrue(p1.IsEqualTo(p2)); }
public void TestGameStateNotEqual1() { List <Player> players = new List <Player>(); players.Add(RM.RandomPlayer(23, 123)); players.Add(RM.RandomPlayer(24, 92)); List <ProjectCard> pc = new List <ProjectCard>(); pc.Add(new ProjectCard(RM.RandomCard(), CardDice.I)); pc.Add(new ProjectCard(RM.RandomCard(), CardDice.II)); pc.Add(new ProjectCard(RM.RandomCard(), CardDice.III)); pc.Add(new ProjectCard(RM.RandomCard(), CardDice.IV)); GameState gs1 = RM.RandomGameState(players, pc, RM.RandomBonusList(20)); GameState gs2 = gs1.Stringify().ParseToGameState(); if (gs2.CurrentRound == Round.A) { gs2.CurrentRound = Round.B; } else { gs2.CurrentRound = Round.A; } Assert.IsFalse(gs1.IsEqualTo(gs2)); }
public void TestParsingPlayer5() { Player p1 = RM.RandomPlayer(50, 100, 0); Player p2 = p1.Stringify().ParseToPlayer(); Assert.IsTrue(p1.IsEqualTo(p2)); }
public void TestParseCard7() { Card c1 = RM.RandomCard(); Card c2 = c1.Stringify().ParseToCard(); Assert.IsTrue(c1.IsEqualTo(c2)); }
public void TestParsingListToString1000() { List <Card> list1 = RM.RandomList(1000); List <Card> list2 = list1.Stringify().ParseToCardsList(); Assert.IsTrue(list1.IsEqualTo(list2)); }
public void TestFindingTripleCards3() { Player player = RandomModels.RandomPlayer(10, 20, 30); player.CompletedProjects.Clear(); Assert.AreEqual(0, player.GetAllTriples().Count); }
public void TestTwoProjectCardsAreNotEqual1() { var card = RM.RandomCard(); ProjectCard pc1 = new ProjectCard(card, CardDice.II); ProjectCard pc2 = new ProjectCard(card, CardDice.I); Assert.IsFalse(pc1.IsEqualTo(pc2)); }
public void TestParsingListToStringNotEqual500() { List <Card> list1 = RM.RandomList(500); List <Card> list2 = list1.Stringify().ParseToCardsList(); list1.Add(RM.RandomCard()); Assert.IsFalse(list1.IsEqualTo(list2)); }
public void TestTwoProjectCardsAreNotEqual2() { var card1 = RM.RandomCard(3); var card2 = RM.RandomCard(4); ProjectCard pc1 = new ProjectCard(card1, CardDice.II); ProjectCard pc2 = new ProjectCard(card2, CardDice.II); Assert.IsFalse(pc1.IsEqualTo(pc2)); }
public void TestParsingPlayer99Times() { for (int i = 0; i < 99; i++) { Player p1 = RM.RandomPlayer(50, 100, 500); Player p2 = p1.Stringify().ParseToPlayer(); Assert.IsTrue(p1.IsEqualTo(p2)); } }
public void TestTwoActionsAreEqual1() { Card targetCard = RM.RandomCard(); Card actionCard = RM.RandomCard(); Models.Action a1 = new Models.Action(ActionType.BonusCarperter, actionCard, targetCard, 5, 6, 7); Models.Action a2 = new Models.Action(ActionType.BonusCarperter, actionCard, targetCard, 5, 6, 7); Assert.IsTrue(a1.IsEqualTo(a2)); }
public void TestTwoActionsAreNotEqual3() { Card targetCard = RM.RandomCard(); Card actionCard = RM.RandomCard(); Models.Action a1 = new Models.Action(ActionType.BonusCastle, actionCard, targetCard, 0, 0, 0); Models.Action a2 = new Models.Action(ActionType.BonusCastle, actionCard, targetCard, 0, 1, 0); Assert.IsFalse(a1.IsEqualTo(a2)); }
public void TestGetNotCompletedTriplesForCard10() { Player player = RandomModels.RandomPlayer(12, 20, 30); var completedProjects = player.CompletedProjects; completedProjects.Clear(); var result = player.GetNotCompletedTriplesForCard(new Card(CardClass.ActionCastle)); Assert.IsTrue(result.Count == 0); }
public void TestGameStateEqual5() { List <Player> players = new List <Player>(); List <ProjectCard> pc = new List <ProjectCard>(); GameState gs1 = RM.RandomGameState(players, pc, new List <BonusCard>()); GameState gs2 = gs1.Stringify().ParseToGameState(); Assert.IsTrue(gs1.IsEqualTo(gs2)); }
public void TestFindingTripleCards2() { Player player = RandomModels.RandomPlayer(10, 20, 30); player.CompletedProjects.Clear(); player.CompletedProjects.Add(new Card(CardClass.ActionCastle, CardDice.I, 0, 1)); player.CompletedProjects.Add(new Card(CardClass.ActionCastle, CardDice.I, 0, 2)); player.CompletedProjects.Add(new Card(CardClass.ActionCastle, CardDice.I, 0, 3)); Assert.AreEqual(3, player.GetAllTriples().Count); }
public void TestListPlayersNotEqual1() { List <Player> l1 = new List <Player>(); List <Player> l2 = new List <Player>(); for (int i = 0; i < 50; i++) { l1.Add(RM.RandomPlayer(20, 30)); l2.Add(RM.RandomPlayer(20, 30)); } Assert.IsFalse(l1.IsEqualTo(l2)); }
public void TestTwoEmptyCardListsAreNotEqual1() { List <Card> list1 = new List <Card>(); List <Card> list2 = new List <Card>(); for (int i = 0; i < 100; i++) { var card = RM.RandomCard(); list1.Add(card); } Assert.IsFalse(list1.IsEqualTo(list2)); }
public void TestListPlayersEquals() { List <Player> l1 = new List <Player>(); List <Player> l2 = new List <Player>(); for (int i = 0; i < 50; i++) { var player = RM.RandomPlayer(20, 30); l1.Add(player); l2.Add(player); } Assert.IsTrue(l1.IsEqualTo(l2)); }
public void TestGameStateEqual2() { List <Player> players = new List <Player>(); players.Add(RM.RandomPlayer(0, 123)); players.Add(RM.RandomPlayer(24, 0)); List <ProjectCard> pc = new List <ProjectCard>(); GameState gs1 = RM.RandomGameState(players, pc, RM.RandomBonusList(20)); GameState gs2 = gs1.Stringify().ParseToGameState(); Assert.IsTrue(gs1.IsEqualTo(gs2)); }
public void TestGetNotCompletedTriplesForCard2() { Player player = RandomModels.RandomPlayer(12, 20, 30); var completedProjects = player.CompletedProjects; completedProjects.Clear(); completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 1)); completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 1)); completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 1)); completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 2)); completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 2)); completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 2)); var result = player.GetNotCompletedTriplesForCard(new Card(CardClass.ActionBank)); Assert.IsTrue(result.Count == 0); }
public void TestGetNotCompletedTriplesForCard5() { Player player = RandomModels.RandomPlayer(12, 20, 30); var completedProjects = player.CompletedProjects; completedProjects.Clear(); completedProjects.Add(new Card(CardClass.ActionMine, CardDice.O, 0, 3)); completedProjects.Add(new Card(CardClass.ActionMine, CardDice.O, 0, 3)); completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 5)); completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 5)); completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 5)); var result = player.GetNotCompletedTriplesForCard(new Card(CardClass.ActionCloister)); Assert.IsTrue(result.Count == 1); Assert.IsTrue(result[0][0].TripleId == 3); }
public void TestGetNotCompletedTriplesForCard7() { Player player = RandomModels.RandomPlayer(12, 20, 30); var completedProjects = player.CompletedProjects; completedProjects.Clear(); completedProjects.Add(new Card(CardClass.ActionBoardinghouse, CardDice.O, 0, 3)); completedProjects.Add(new Card(CardClass.ActionCityHall, CardDice.O, 0, 3)); completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 5)); completedProjects.Add(new Card(CardClass.ActionBank, CardDice.O, 0, 5)); var result = player.GetNotCompletedTriplesForCard(new Card(CardClass.ActionBank)); Assert.IsTrue(result.Count == 2); Assert.IsTrue(result[0][0].TripleId == 3); Assert.IsTrue(result[1][0].TripleId == 5); }
public void TestGetNotCompletedTriplesForCard14() { Player player = RandomModels.RandomPlayer(12, 20, 30); var completedProjects = player.CompletedProjects; completedProjects.Clear(); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 1)); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 1)); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 2)); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 2)); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 3)); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 3)); var result = player.GetNotCompletedTriplesForCard(new Card(CardClass.ActionMine)); Assert.AreEqual(0, result.Count); }
public void TestEnumListEqual() { List <BonusCard> list1 = new List <BonusCard>(); List <BonusCard> list2 = new List <BonusCard>(); BonusCard b1 = RM.RandomBonusCard(); BonusCard b2 = RM.RandomBonusCard(); BonusCard b3 = RM.RandomBonusCard(); list1.Add(b1); list1.Add(b2); list1.Add(b3); list2.Add(b1); list2.Add(b2); list2.Add(b3); Assert.IsTrue(list1.IsEqualTo(list2)); }
public void TestGameStateNotEqual7() { List <Player> players = new List <Player>(); players.Add(RM.RandomPlayer(23, 123)); players.Add(RM.RandomPlayer(24, 92)); List <ProjectCard> pc = new List <ProjectCard>(); pc.Add(new ProjectCard(RM.RandomCard(), CardDice.I)); pc.Add(new ProjectCard(RM.RandomCard(), CardDice.II)); pc.Add(new ProjectCard(RM.RandomCard(), CardDice.III)); pc.Add(new ProjectCard(RM.RandomCard(), CardDice.IV)); GameState gs1 = RM.RandomGameState(players, pc, RM.RandomBonusList(20)); GameState gs2 = gs1.Stringify().ParseToGameState(); gs2.AvailableBonusCards.Clear(); Assert.IsFalse(gs1.IsEqualTo(gs2)); }
public void TestGetNotCompletedTriplesForCard8() { Player player = RandomModels.RandomPlayer(12, 20, 30); var completedProjects = player.CompletedProjects; completedProjects.Clear(); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 1)); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 1)); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 1)); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 2)); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 2)); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 2)); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 3)); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 3)); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 3)); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 4)); completedProjects.Add(new Card(CardClass.ActionCastle, CardDice.O, 0, 4)); var result = player.GetNotCompletedTriplesForCard(new Card(CardClass.ActionCastle)); Assert.IsTrue(result.Count == 1); Assert.IsTrue(result[0][0].TripleId == 4); }
public void TestPlayerEquals4() { Player p1 = RM.RandomPlayer(0, 0); Assert.IsTrue(p1.IsEqualTo(p1)); }