Esempio n. 1
0
        public void AddSequence_WillAddItemToList()
        {
            var moveManager = new MoveManager(new MoveGenerator());

            moveManager.AddMove(GameTile.BottomRight);

            Assert.AreEqual(1, moveManager.GameSequence.Count);
        }
Esempio n. 2
0
        public void LastMoveIndex_WhenMoveMade_WhenValid_WillIncrementIndex()
        {
            var moveManager = new MoveManager(new MoveGenerator());

            var originalIndex = moveManager.LastMoveIndex;

            moveManager.AddMove(GameTile.TopLeft);

            moveManager.MakeMove(GameTile.TopLeft);

            var updatedIndex = moveManager.LastMoveIndex;

            Assert.AreNotEqual(originalIndex, updatedIndex);
        }
Esempio n. 3
0
        public void MakeMove_WhenMoveIsValid_WillReturnCorrectResult()
        {
            var moveManager = new MoveManager(new MoveGenerator());

            moveManager.AddMove(GameTile.BottomRight);
            moveManager.AddMove(GameTile.BottomRight);
            moveManager.AddMove(GameTile.BottomLeft);

            var expectedResult = AttemptResult.Valid;
            var result = moveManager.MakeMove(GameTile.BottomRight);

            Assert.AreEqual(expectedResult, result);
        }
Esempio n. 4
0
        public void MakeMove_WhenMultipleMoves_WillAllBeValud()
        {
            var moveManager = new MoveManager(new MoveGenerator());

            moveManager.AddMove(GameTile.BottomRight);
            moveManager.AddMove(GameTile.BottomRight);
            moveManager.AddMove(GameTile.BottomLeft);

            var result1 = moveManager.MakeMove(GameTile.BottomRight);
            var result2 = moveManager.MakeMove(GameTile.BottomRight);
            var result3 = moveManager.MakeMove(GameTile.BottomLeft);

            Assert.AreEqual(AttemptResult.Valid, result1);
            Assert.AreEqual(AttemptResult.Valid, result2);
            Assert.AreEqual(AttemptResult.Valid, result3);
        }