public void TestDoubleGetsEatenAndGetsOut() { var pos = getStartPositions(); pos[0] = pos[1] = Position.RedStart; var sit = new Situation(pos); var moves = sit.GetMoves(Piece.Red, 6); sit.ApplyMove(moves[0]); moves = sit.GetMoves(Piece.Green, 6); sit.ApplyMove(moves[0]); Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenStart]); Assert.AreEqual(Piece.None, sit.board[(int)Position.GreenHome1]); Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenHome2]); Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenHome3]); Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenHome4]); Assert.IsTrue(sit.Validate()); }
public void TestDoubleArrivesToGoal3() { var pos = getStartPositions(); pos[0] = pos[1] = Position.Yellow6; var sit = new Situation(pos); var moves = sit.GetMoves(Piece.Green, 3); sit.ApplyMove(moves[0]); Assert.AreEqual(1, moves.Length); Assert.AreEqual(Position.GreenGoal3, moves[0].EndPosition); Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenGoal1]); Assert.AreEqual(Piece.None, sit.board[(int)Position.GreenGoal2]); Assert.AreEqual(Piece.Green, sit.board[(int)Position.GreenGoal3]); Assert.AreEqual(Piece.None, sit.board[(int)Position.GreenGoal4]); Assert.IsTrue(sit.Validate()); }