public void TestExecute()
        {
            var testClass = new TestClass();
            var command   = new SerializableCommand <TestClass>(testClass, t => t.IncreaseNumber());

            command.Execute();
            Assert.AreEqual(1, testClass.number);
        }
Exemplo n.º 2
0
        public void TestOperateOnState()
        {
            var gameStateChanger = new GameStateChanger();
            var increaseNumberOfEnemiesCommand = new SerializableCommand <GameStateChanger>
                                                     (gameStateChanger, changer => changer.IncreaseNumberOfEnemies());

            increaseNumberOfEnemiesCommand.Execute();

            Assert.AreEqual(1, TestGameState.Instance.numberOfEnemies);
            Assert.AreEqual(0, TestGameState.Instance.numberOfPlayers);
        }