Esempio n. 1
0
        public void TestSetChar()
        {
            var bm = new BoardModel();

            bm.SetPlayer1("a1");
            bm.SetPlayer2("b1");

            Assert.Equal(CellOwner.Player1, bm.GetSymbol(0));
            Assert.Equal(CellOwner.Player2, bm.GetSymbol(1));
        }
Esempio n. 2
0
        private static bool CheckCells(BoardModel bm, int cellIndex0, int cellIndex1, int cellIndex2)
        {
            var cell0 = bm.GetSymbol(cellIndex0);
            var cell1 = bm.GetSymbol(cellIndex1);
            var cell2 = bm.GetSymbol(cellIndex2);

            if (cell0 == CellOwner.None || cell1 != cell0 || cell2 != cell0)
            {
                return(false);
            }

            Winner = cell0 == CellOwner.Player1 ? "Du" : "Datamaskinen";
            return(true);
        }