Пример #1
0
        public void ExecuteInvokesAction()
        {
            var invoked = false;

            Action<object> action = obj => invoked = true;

            var command = new ActionCommand(action);

            command.Execute();

            Assert.IsTrue(invoked);
        }
Пример #2
0
        public void ExecuteOverloadInvokesActionWithParameter()
        {
            var invoked = false;

            Action<object> action = obj =>
                                    {
                                        Assert.IsNotNull(obj);
                                        invoked = true;
                                    };

            var command = new ActionCommand(action);

            command.Execute(new object());

            Assert.IsTrue(invoked);
        }