コード例 #1
0
        public void IsSingleMoveDownValid()
        {
            INextValueGenerator <sbyte> generatorMock = MockRepository.GenerateStub <INextValueGenerator <sbyte> >();

            generatorMock.Stub(m => m.NextPosition(Arg <sbyte> .Is.Anything)).Return(0); //put initial value to cell "0" [0,0]
            generatorMock.Stub(m => m.NextValue()).Return(2);                            //cell Value shall be 2
            IGameBoard board = InitBoard(4, generatorMock);

            board.MoveDown(); //Now cell [3,0] must contains 2
            Assert.AreEqual(board.To2DArray()[board.Size - 1, 0].Value, 2);
        }