示例#1
0
        public void TestAddStone()
        {
            Omok game = new Omok();

            game.AddStone(1, 1);
            bool result = game.AddStone(1, 1);

            Assert.AreEqual(0, result);
        }
示例#2
0
        public void TestDiagonalGameover()
        {
            Omok game = new Omok();

            for (int i = 15; i >= 12; i--)
            {
                game.AddStone(i, i);     //P1.
                game.AddStone(i - 1, i); //P2.
            }
            game.AddStone(11, 11);
            Assert.AreEqual(1, game.Check(11, 11));
        }
示例#3
0
        public void TestHorizontalGameover()
        {
            Omok game = new Omok();

            for (int i = 1; i <= 4; i++)
            {
                game.AddStone(i, 1);    //P1.
                game.AddStone(i, 2);    //P2.
            }
            game.AddStone(5, 1);
            int result = game.Check(5, 1);

            Assert.AreEqual(1, result);
        }
示例#4
0
        public void TestVerticalGameover()
        {
            Omok game = new Omok();

            for (int i = 1; i <= 4; i++)
            {
                game.AddStone(1, i);    //P1.
                game.AddStone(2, i);    //P2.
            }
            game.AddStone(1, 5);
            int result = game.Check(1, 5);

            Assert.AreEqual(1, result);
        }