Esempio n. 1
0
        public void TestCustomCommand_CanExecute()
        {
            var           fact = Substitute.For <CustomCommandFactory>();
            CustomCommand cmd  = fact.Create() as CustomCommand;

            Assert.IsNotNull(cmd);

            object arg1      = null;
            bool   ret1      = cmd.CanExecute(arg1);
            bool   expected1 = false;

            Assert.IsFalse(ret1);
            Assert.AreEqual(expected1, ret1);

            object arg2      = new Object();
            bool   ret2      = cmd.CanExecute(arg2);
            bool   expected2 = true;

            Assert.IsTrue(ret2);
            Assert.AreEqual(expected2, ret2);
        }