예제 #1
0
        public void testSimpleDiagonalAttack()
        {
            XYLocation loc = new XYLocation(3, 3);

            board.addQueenAt(loc);
            Assert.AreEqual(0, board.getNumberOfAttacksOn(loc));
            Assert.AreEqual(1, board.getNumberOfAttacksOn(loc.Down().Right()));
            Assert.AreEqual(1, board.getNumberOfAttacksOn(loc.Down().Left()));
            Assert.AreEqual(1, board.getNumberOfAttacksOn(loc.Up().Left()));
            Assert.AreEqual(1, board.getNumberOfAttacksOn(loc.Up().Right()));
            Assert.AreEqual(1, board.getNumberOfAttacksOn(new XYLocation(7, 7)));
            Assert.AreEqual(1, board.getNumberOfAttacksOn(new XYLocation(0, 0)));
            Assert.AreEqual(1, board.getNumberOfAttacksOn(new XYLocation(6, 0)));
            Assert.AreEqual(1, board.getNumberOfAttacksOn(new XYLocation(0, 6)));
        }