示例#1
0
        public void HaveVictoryAt()
        {
            Board board = new Board(5);
            board.PutStone(CellState.Black, 0, 2);
            board.PutStone(CellState.White, 1, 2);
            board.PutStone(CellState.White, 3, 2);

            Logic logic = new LogicStub(board, 5);

            Assert.IsFalse(logic.HaveVictoryAt(2, 2, CellState.White));

            board.PutStone(CellState.White, 4, 2);
            Assert.IsFalse(logic.HaveVictoryAt(2, 2, CellState.White));

            board.PutStone(CellState.White, 0, 2);
            Assert.IsFalse(logic.HaveVictoryAt(2, 2, CellState.White));

            board.PutStone(CellState.White, 2, 2);
            Assert.IsTrue(logic.HaveVictoryAt(2, 2, CellState.White));
            Assert.IsFalse(logic.HaveVictoryAt(2, 1, CellState.White));
            Assert.IsFalse(logic.HaveVictoryAt(2, 2, CellState.Black));
        }