Пример #1
0
        public void ShouldReturnHandledCommandState()
        {
            IContext context = new Context();

            context = context.Add(Keys.A);

            var command = new ClearStackCommand();
            var result  = command.Execute(context, Keys.B);

            Assert.Equal(CommandState.Handled, result.State);
        }
Пример #2
0
        public void ShouldClearContextStackWhenExecuted()
        {
            IContext context = new Context();

            context = context.Add(Keys.A);

            var command = new ClearStackCommand();
            var result  = command.Execute(context, Keys.B);

            Assert.False(result.Context.Stack.Any());
        }