Beispiel #1
0
 public void TestTieGame()
 {
     int[] configuration = new[] {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 2};
     IBoard b = BoardConfiguration.Create(Player.Player1, configuration);
     IView v = MockRepository.GenerateMock<IView>();
     IReferree r = new Referree
                       {
                           RulesEngine = new RulesEngine1(),
                           Board = b,
                           View = v
                       };
     r.View.Expect(x => x.DisplayModalMessage("tie!")).Constraints(Is.Equal("tie!"));
     r.ReceiveMove(b.Cups.ToArray()[5]);
     Assert.AreEqual(new[] {0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2},
                     BoardConfiguration.GetConfiguration(b));
     v.VerifyAllExpectations();
 }
Beispiel #2
0
 public void TestPlayer1WinsByClaimingRemainingSeeds()
 {
     var configuration = new[] {0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1};
     IBoard b = BoardConfiguration.Create(Player.Player1, configuration);
     var v = MockRepository.GenerateMock<IView>();
     IReferree r = new Referree
                       {
                           RulesEngine = new RulesEngine1(),
                           Board = b,
                           View = v
                       };
     r.View.Expect(x => x.DisplayModalMessage("Player1 won!")).Constraints(Is.Equal("Player1 won!"));
     r.ReceiveMove(b.Cups.ToArray()[5]);
     Assert.AreEqual(new[] {0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1},
                     BoardConfiguration.GetConfiguration(b));
     v.VerifyAllExpectations();
 }