public void Board_CanMoveWithoutBreakingHive_ClosedCircleTest() { MockBoard b = new MockBoard("Base;InProgress;Black[4];WQ[-1,0,1];WS1[0,0,0];WG1[-2,1,1];BQ[-1,2,-1];BS1[0,1,-1];BG1[-2,2,0]"); foreach (PieceName pieceName in b.PiecesInPlay) { VerifyCanMoveWithoutBreakingHive(b, pieceName, true); } }
public void Board_CanMoveWithoutBreakingHive_OpenCircleTest() { MockBoard b = new MockBoard("Base;InProgress;Black[3];WQ[-1,0,1];WS1[0,0,0];WG1[-2,1,1];BQ[-1,2,-1];BS1[0,1,-1]"); foreach (PieceName pieceName in b.PiecesInPlay) { VerifyCanMoveWithoutBreakingHive(b, pieceName, pieceName == PieceName.WhiteGrasshopper1 || pieceName == PieceName.BlackQueenBee); } }
public void Board_IsOneHive_TwoHivesTest() { MockBoard b = new MockBoard("Base;InProgress;Black[3];WQ[-1,0,1];WS1[0,0,0];WG1[-2,1,1];BQ[-1,2,-1];BS1[0,1,-1]"); Assert.IsTrue(b.IsOneHive()); b.MovePiece(b.GetPiece(PieceName.WhiteSpider1), null); Assert.IsFalse(b.IsOneHive()); }
private void VerifyCanMoveWithoutBreakingHive(MockBoard board, PieceName pieceName, bool canMoveExpected) { Assert.IsNotNull(board); Piece piece = board.GetPiece(pieceName); Assert.IsNotNull(piece); bool canMoveActual = board.CanMoveWithoutBreakingHive(piece); Assert.AreEqual(canMoveExpected, canMoveActual); }
public void Board_IsOneHive_OnePieceTest() { MockBoard b = new MockBoard("Base;InProgress;Black[1];WS1[0,0,0]"); Assert.IsTrue(b.IsOneHive()); }
public void Board_IsOneHive_NewGameTest() { MockBoard b = new MockBoard(); Assert.IsTrue(b.IsOneHive()); }
public void Board_CanMoveWithoutBreakingHive_OnlyPieceInPlayTest() { MockBoard b = new MockBoard("Base;InProgress;Black[1];WS1[0,0,0]"); VerifyCanMoveWithoutBreakingHive(b, PieceName.WhiteSpider1, true); }
public void Board_CanMoveWithoutBreakingHive_InHandTest() { MockBoard b = new MockBoard(); VerifyCanMoveWithoutBreakingHive(b, PieceName.WhiteSpider1, true); }
public void Board_IsOneHive_OpenCircleTest() { MockBoard b = new MockBoard("Base;InProgress;Black[3];WQ[-1,0,1];WS1[0,0,0];WG1[-2,1,1];BQ[-1,2,-1];BS1[0,1,-1]"); Assert.IsTrue(b.IsOneHive()); }