Exemple #1
0
        public void Test1()
        {
            var manager = new CommandManager();

            var command = new MyFirstCommand("my command");

            manager.Invoke(command);
        }
Exemple #2
0
        public void Test2()
        {
            var manager = new CommandManager();

            var command = new MyFirstCommand(string.Empty);

            manager.Invoke(command);
        }
Exemple #3
0
        public void Test3()
        {
            var manager       = new CommandManager();
            var firstCommand  = new MyFirstCommand("my first command");
            var secondCommand = new MySecondCommand(1, "my second command");

            manager.Invoke(firstCommand);
            manager.Invoke(secondCommand);

            manager.Undo();
        }
        public void WhenExecuted_CommandShouldReportSuccess()
        {
            // arrange
            var command = new MyFirstCommand(1, string.Empty);

            // act
            _dispatcher.Send(command);
            var inquiry = new Inquiry(_getCommandResult);
            var answer  = inquiry.For(command);

            // assert
            Assert.IsTrue(answer.Success);
        }