예제 #1
0
        public void Constructor_PredicateConditionsAreNotMet_CommandDoesNotExecute()
        {
            int num = 4;
            CommandRelay relay = new CommandRelay((x) => SomeMethodThatDoesSomething(), (y) => (int)y > 5);

            Assert.IsFalse(relay.CanExecute(num));
        }
예제 #2
0
        public void Constructor_PredicateIsNull_CommandExecutes()
        {
            CommandRelay relay = new CommandRelay((x) => SomeMethodThatDoesSomething(), null);

            Assert.IsTrue(relay.CanExecute(new object()));
        }
예제 #3
0
        public void Constructor_ActionIsNull_CommandDoesNotExecute()
        {
            CommandRelay relay = new CommandRelay(null);

            Assert.IsFalse(relay.CanExecute(new object()));
        }