Beispiel #1
0
        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);
            }
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        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());
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        public void Board_IsOneHive_OnePieceTest()
        {
            MockBoard b = new MockBoard("Base;InProgress;Black[1];WS1[0,0,0]");

            Assert.IsTrue(b.IsOneHive());
        }
Beispiel #6
0
        public void Board_IsOneHive_NewGameTest()
        {
            MockBoard b = new MockBoard();

            Assert.IsTrue(b.IsOneHive());
        }
Beispiel #7
0
        public void Board_CanMoveWithoutBreakingHive_OnlyPieceInPlayTest()
        {
            MockBoard b = new MockBoard("Base;InProgress;Black[1];WS1[0,0,0]");

            VerifyCanMoveWithoutBreakingHive(b, PieceName.WhiteSpider1, true);
        }
Beispiel #8
0
        public void Board_CanMoveWithoutBreakingHive_InHandTest()
        {
            MockBoard b = new MockBoard();

            VerifyCanMoveWithoutBreakingHive(b, PieceName.WhiteSpider1, true);
        }
Beispiel #9
0
        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());
        }