Exemplo n.º 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));
        }
Exemplo n.º 2
0
        public void Constructor_PredicateIsNull_CommandExecutes()
        {
            CommandRelay relay = new CommandRelay((x) => SomeMethodThatDoesSomething(), null);

            Assert.IsTrue(relay.CanExecute(new object()));
        }
Exemplo n.º 3
0
        public void Constructor_ActionIsNull_CommandDoesNotExecute()
        {
            CommandRelay relay = new CommandRelay(null);

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