public void FiveByFiveOpenTerritory() { var board = new GoCounting(boardFiveByFive); var result = board.TerritoryFor(new Point(1, 4)); Assert.That(result.Item1, Is.EqualTo(GoCounting.Player.None)); Assert.That(result.Item2, Is.EquivalentTo(new[] { new Point(0, 3), new Point(0, 4), new Point(1, 4) })); }
public void FiveByFiveTerritoryForBlack() { var board = new GoCounting(boardFiveByFive); var result = board.TerritoryFor(new Point(0, 1)); Assert.That(result.Item1, Is.EqualTo(GoCounting.Player.Black)); Assert.That(result.Item2, Is.EquivalentTo(new[] { new Point(0, 0), new Point(0, 1), new Point(1, 0) })); }
public void FiveByFiveTerritoryForWhite() { var board = new GoCounting(boardFiveByFive); var result = board.TerritoryFor(new Point(2, 3)); Assert.That(result.Item1, Is.EqualTo(GoCounting.Player.White)); Assert.That(result.Item2, Is.EquivalentTo(new[] { new Point(2, 3) })); }
public void FiveByFiveOpenTerritory() { var board = new GoCounting(boardFiveByFive); var result = board.TerritoryFor(new Tuple <int, int>(1, 4)); var expected = new HashSet <Tuple <int, int> > { new Tuple <int, int>(0, 3), new Tuple <int, int>(0, 4), new Tuple <int, int>(1, 4) }; Assert.Equal(GoPlayer.None, result.Item1); Assert.True(expected.SetEquals(result.Item2)); }
public void FiveByFiveTerritoryForWhite() { var board = new GoCounting(boardFiveByFive); var result = board.TerritoryFor(new Tuple <int, int>(2, 3)); var expected = new HashSet <Tuple <int, int> > { new Tuple <int, int>(2, 3) }; Assert.Equal(GoPlayer.White, result.Item1); Assert.True(expected.SetEquals(result.Item2)); }
public void FiveByFiveTerritoryForBlack() { var board = new GoCounting(boardFiveByFive); var result = board.TerritoryFor(new Tuple <int, int>(0, 1)); var expected = new HashSet <Tuple <int, int> > { new Tuple <int, int>(0, 0), new Tuple <int, int>(0, 1), new Tuple <int, int>(1, 0) }; Assert.Equal(GoPlayer.Black, result.Item1); Assert.True(expected.SetEquals(result.Item2)); }
public void FiveByFiveNonTerritoryDueToTooHighCoordinate() { var board = new GoCounting(boardFiveByFive); Assert.That(board.TerritoryFor(new Point(1, 5)), Is.Null); }
public void FiveByFiveNonTerritoryStone() { var board = new GoCounting(boardFiveByFive); Assert.That(board.TerritoryFor(new Point(1, 1)), Is.Null); }
public void FiveByFiveNonTerritoryDueToTooHighCoordinate() { var board = new GoCounting(boardFiveByFive); Assert.Null(board.TerritoryFor(new Tuple <int, int>(1, 5))); }
public void FiveByFiveNonTerritoryStone() { var board = new GoCounting(boardFiveByFive); Assert.Null(board.TerritoryFor(new Tuple <int, int>(1, 1))); }