示例#1
0
        public void TestExtractHorizontal()
        {
            TicTacToe t = new TicTacToe("XOX\nOXO\nXXO");

            int[] tr1 = { 1, 2, 1 };
            CollectionAssert.AreEqual(tr1, t.extract_row(0));
            CollectionAssert.AreEqual(tr1, t.extract_row(1));
            CollectionAssert.AreEqual(tr1, t.extract_row(2));

            int[] tr2 = { 2, 1, 2 };
            CollectionAssert.AreEqual(tr2, t.extract_row(3));
            CollectionAssert.AreEqual(tr2, t.extract_row(4));
            CollectionAssert.AreEqual(tr2, t.extract_row(5));

            TicTacToe t2 = new TicTacToe("XOXO\nOXOX\nXXOO\nOOXX\nXOOX");

            int[] t2r1 = { 1, 1, 2, 2 };
            CollectionAssert.AreEqual(t2r1, t2.extract_row(9));
        }
示例#2
0
        public void TestExtractColumn2()
        {
            TicTacToe t = new TicTacToe("XOX\nOXO\nXXO");

            Assert.That(() => t.extract_row(9), Throws.TypeOf <IndexOutOfRangeException>());
        }