public void R21_a_game_will_also_be_ended_by_repetition_each_player_captures_the_stones_on_their_side_of_the_board() { var board = new AwariBoard( f: 1, F: 1, southAwari: 22, northAwari: 24); board.Sow("F").Sow("f").Sow("A").Sow("a").Sow("B").Sow("b").Sow("C").Sow("c").Sow("D").Sow("d").Sow("E"); board.GameHasEnded.Should().BeFalse(); board.SouthAwari.Should().Be(22); board.NorthAwari.Should().Be(24); board.Sow("e"); board.GameHasEnded.Should().BeTrue(); board.SouthAwari.Should().Be(23); board.NorthAwari.Should().Be(25); }
public void R14_the_original_pit_is_skipped_whenever_it_is_encountered() { var board = new AwariBoard( f: 3, e: 3, d: 3, c: 3, b: 3, a: 3, A: 3, B: 0, C: 3, D: 3, E: 15, F: 3, southAwari: 1, northAwari: 2); board.Sow("E"); board.Pits["E"].Should().Be(0); }
private void CaptureTest(int stonesInEndPit, int expectedStonesLeftInEndPit, int expectedStonesInSouthAwari) { var board = new AwariBoard( a: 0, b: 4, c: 4, d: stonesInEndPit, e: 4, f: 4, A: 4, B: 4, C: 4, D: 4, E: 4, F: 4, southAwari: 0, northAwari: 8 - stonesInEndPit); board.Sow("F"); board.Pits["d"].Should().Be(expectedStonesLeftInEndPit); board.SouthAwari.Should().Be(expectedStonesInSouthAwari); }
public void R19_a_game_will_be_ended_by_a_player_being_unable_to_move_in_which_case_the_remaining_stones_on_the_board_belong_to_the_opponent() { var board = new AwariBoard( A: 2, B: 1, C: 1, southAwari: 21, northAwari: 23); board.Sow("A"); board.Pits["A"].Should().Be(0); board.Pits["B"].Should().Be(0); board.Pits["C"].Should().Be(0); board.GameHasEnded.Should().BeTrue(); board.SouthAwari.Should().Be(25); }
public void R16_if_the_previous_pit_then_contains_a_group_of_two_or_three_stones_these_stones_are_also_captured_and_so_forth() { var board = new AwariBoard( f: 4, e: 4, d: 4, c: 1, b: 2, a: 1, A: 11, B: 4, C: 6, D: 4, E: 4, F: 3, southAwari: 0, northAwari: 0); board.Sow("C"); board.Pits["a"].Should().Be(0); board.Pits["b"].Should().Be(0); board.Pits["c"].Should().Be(0); board.SouthAwari.Should().Be(7); }
public void R17_the_set_of_pits_which_are_captured_is_on_the_opponents_side_of_the_board_reachable_by_captures_from_the_last_pit_sown() { // Arrange var board = new AwariBoard( f: 4, e: 4, d: 4, c: 1, b: 2, a: 1, A: 13, B: 4, C: 6, D: 4, E: 4, F: 1, southAwari: 0, northAwari: 0); // Act board.Sow("C"); // Assert board.Pits["F"].Should().Be(2); board.Pits["a"].Should().Be(0); board.Pits["b"].Should().Be(0); board.Pits["c"].Should().Be(0); board.SouthAwari.Should().Be(7); }
public void R08_the_players_alternate_moves() { _initialBoard.Sow("B"); _initialBoard.FirstToMove.Should().Be(AwariPlayer.North); _initialBoard.Invoking(x => x.Sow("F")).Should().Throw <ArgumentException>().WithMessage("South already moved, a player cannot make two moves in a row."); }