コード例 #1
0
 public void GameProperReAssignmentTest()
 {
     WarPlayer target = new WarPlayer();
     AbstractWarGame expected = new MockWarGame(WarGameState.AtBattle);
     target.Game = new MockWarGame(WarGameState.AtBattle);
     target.Game = null;
     target.Game = expected;
     Assert.AreEqual(expected, target.Game);
 }
コード例 #2
0
 public void GameSimpleAssignmentTest()
 {
     WarPlayer target = new WarPlayer(); // TODO: Initialize to an appropriate value
     AbstractWarGame expected = new MockWarGame(WarGameState.AtBattle);
     AbstractWarGame actual = expected;
     target.Game = expected;
     actual = target.Game;
     Assert.AreEqual(expected, actual);
 }
コード例 #3
0
 public void PlayWithoutCardsTest()
 {
     WarPlayer target = new WarPlayer(); // TODO: Initialize to an appropriate value
     MockWarGame warGame = new MockWarGame(WarGameState.AtBattle);
     target.Game = warGame;
     target.Play();
     warGame.AssertCallCounts(
         playerBattle: 1,
         playerGoToWar: 0,
         playerPickWarAttack: 0);
 }
コード例 #4
0
 public void PlayWarDeclaredTest()
 {
     WarPlayer target = new WarPlayer();
     target.Cards.AddRange(CardList.CreateDeck());
     MockWarGame warGame = new MockWarGame(WarGameState.WarDeclared);
     target.Game = warGame;
     target.Play();
     warGame.AssertCallCounts(playerGoToWar: 1);
 }
コード例 #5
0
 public void PlayGameOverTest()
 {
     WarPlayer target = new WarPlayer();
     target.Cards.AddRange(CardList.CreateDeck());
     MockWarGame warGame = new MockWarGame(WarGameState.GameOver);
     target.Game = warGame;
     target.Play();
     warGame.AssertCallCounts();
 }
コード例 #6
0
 public void PlayAtWarBattleTest()
 {
     WarPlayer target = new WarPlayer();
     target.Cards.AddRange(CardList.CreateDeck());
     MockWarGame warGame = new MockWarGame(WarGameState.WarDeclared);
     target.Game = warGame;
     target.Play();
     warGame.SetGameState(WarGameState.AtWar);
     target.Play();
     warGame.AssertCallCounts(playerGoToWar:1, playerPickWarAttack:1, lastAttackIndex:2);
 }
コード例 #7
0
 public void PlayAtBattleTest()
 {
     WarPlayer target = new WarPlayer(); // TODO: Initialize to an appropriate value
     target.Cards.AddRange(CardList.CreateDeck());
     MockWarGame warGame = new MockWarGame(WarGameState.AtBattle);
     target.Game = warGame;
     target.Play();
     warGame.AssertCallCounts(playerBattle:1);
 }