예제 #1
0
        public void ExecuteInvokesAction()
        {
            bool invoked = false;

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

            RelayCommand command = new RelayCommand(action);

            command.Execute(null);

            Assert.IsTrue(invoked);
        }
예제 #2
0
        public void ExecuteOverloadInvokesActionWithParameter()
        {
            bool invoked = false;

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

            RelayCommand command = new RelayCommand(action);

            command.Execute(new object());

            Assert.IsTrue(invoked);
        }