Exemple #1
0
        public void IdentifyDiagonalStraightFromRightTop()
        {
            var moveList   = new MoveList();
            var winChecker = new WinChecker();

            moveList.AddMove(new Move(2, 2));
            moveList.AddMove(new Move(2, 3));
            moveList.AddMove(new Move(1, 3));
            moveList.AddMove(new Move(3, 1));

            bool diagonal3InARow = winChecker.CheckForDiagonalWin(moveList.Moves);

            Assert.True(diagonal3InARow);
        }
Exemple #2
0
        public void IndenifyThisRandomWin()
        {
            var moveList   = new MoveList();
            var winChecker = new WinChecker();

            moveList.AddMove(new Move(2, 4));
            moveList.AddMove(new Move(4, 2));
            moveList.AddMove(new Move(1, 3));
            moveList.AddMove(new Move(3, 3));

            bool diagonal3InARow = winChecker.CheckForDiagonalWin(moveList.Moves);

            Assert.True(diagonal3InARow);
        }
Exemple #3
0
        public void IdentifyNotADiagonalWin()
        {
            var moveList   = new MoveList();
            var winChecker = new WinChecker();

            moveList.AddMove(new Move(2, 1));
            moveList.AddMove(new Move(2, 3));
            moveList.AddMove(new Move(1, 1));
            moveList.AddMove(new Move(3, 3));

            var diagonal3InARow = winChecker.CheckForDiagonalWin(moveList.Moves);

            Assert.False(diagonal3InARow);
        }