示例#1
0
        public void InitBoardTest()
        {
            var board = new BsBoard2D(5, 5);

            Assert.AreEqual(25, board.SlotsCount());
            Assert.AreEqual(25, board.FreeSlotsCount());
            Assert.AreEqual(25, board.FreeSlots().Count());
        }
示例#2
0
        public void AddActorTest()
        {
            var board  = new BsBoard2D(10, 10);
            var actor1 = new Mock <IBsActor>();
            var actor2 = new Mock <IBsActor>();

            Assert.IsTrue(board.Add(actor1.Object, 0));
            Assert.AreEqual(99, board.FreeSlotsCount());
            Assert.AreEqual(99, board.FreeSlots().Count());

            Assert.IsFalse(board.Add(actor2.Object, 0));
            Assert.IsFalse(board.Add(actor1.Object, 0));
            Assert.IsFalse(board.Add(actor1.Object, 1));
            Assert.AreEqual(99, board.FreeSlotsCount());
            Assert.AreEqual(99, board.FreeSlots().Count());

            board.Add(actor2.Object, 1);
            Assert.AreEqual(98, board.FreeSlotsCount());
            Assert.AreEqual(98, board.FreeSlots().Count());
        }