Exemplo n.º 1
0
        private void Diagonal1()
        {
            var boardState = new Dictionary <Cell, Color>();

            boardState.Add(Cell(1, 1), Color.Yellow);
            boardState.Add(Cell(2, 1), Color.Yellow);
            boardState.Add(Cell(3, 1), Color.Yellow);
            boardState.Add(Cell(1, 2), Color.Yellow);
            boardState.Add(Cell(2, 2), Color.Yellow);
            boardState.Add(Cell(1, 3), Color.Yellow);

            boardState.Add(Cell(1, 4), Color.Red);
            boardState.Add(Cell(2, 3), Color.Red);
            boardState.Add(Cell(3, 2), Color.Red);
            boardState.Add(Cell(4, 1), Color.Red);

            TestReferee.Draw(boardState);

            Assert.True(TestReferee.Diagonal(boardState, Cell(1, 4)));
            Assert.True(TestReferee.Diagonal(boardState, Cell(2, 3)));
            Assert.True(TestReferee.Diagonal(boardState, Cell(3, 2)));
            Assert.True(TestReferee.Diagonal(boardState, Cell(4, 1)));
        }
Exemplo n.º 2
0
        private void Diagonal8()
        {
            var boardState = new Dictionary <Cell, Color>();

            boardState.Add(Cell(5, 1), Color.Yellow);
            boardState.Add(Cell(6, 1), Color.Yellow);
            boardState.Add(Cell(6, 2), Color.Yellow);
            boardState.Add(Cell(7, 1), Color.Yellow);
            boardState.Add(Cell(7, 2), Color.Yellow);
            boardState.Add(Cell(7, 3), Color.Yellow);

            boardState.Add(Cell(1, 3), Color.Red);
            boardState.Add(Cell(2, 4), Color.Red);
            boardState.Add(Cell(3, 5), Color.Red);
            boardState.Add(Cell(4, 6), Color.Red);

            TestReferee.Draw(boardState);

            Assert.True(TestReferee.Diagonal(boardState, Cell(1, 3)));
            Assert.True(TestReferee.Diagonal(boardState, Cell(2, 4)));
            Assert.True(TestReferee.Diagonal(boardState, Cell(3, 5)));
            Assert.True(TestReferee.Diagonal(boardState, Cell(4, 6)));
        }