Beispiel #1
0
      public void TestExecuteWhenCanExecuteIsFalse()
      {
         Mock<ICommand> testCommand = new Mock<ICommand>();
         testCommand.Setup(c => c.CanExecute()).Returns(false);

         CommandInfo ci = new CommandInfo();
         ci.Executor(testCommand.Object);
         ci.Execute();

         testCommand.Verify(c => c.Execute(), Times.Never());
      }
Beispiel #2
0
      public void TestExecute()
      {
         Mock<ICommand> testCommand = new Mock<ICommand>();
         testCommand.Setup(c => c.CanExecute()).Returns(true);

         CommandInfo ci = new CommandInfo();
         ci.Executor(testCommand.Object);
         ci.Execute();

         testCommand.Verify(c => c.Execute(), Times.Once());
      }
Beispiel #3
0
        public void TestExecuteWhenCanExecuteIsFalse()
        {
            Mock <ICommand> testCommand = new Mock <ICommand>();

            testCommand.Setup(c => c.CanExecute()).Returns(false);

            CommandInfo ci = new CommandInfo();

            ci.Executor(testCommand.Object);
            ci.Execute();

            testCommand.Verify(c => c.Execute(), Times.Never());
        }
Beispiel #4
0
        public void TestExecute()
        {
            Mock <ICommand> testCommand = new Mock <ICommand>();

            testCommand.Setup(c => c.CanExecute()).Returns(true);

            CommandInfo ci = new CommandInfo();

            ci.Executor(testCommand.Object);
            ci.Execute();

            testCommand.Verify(c => c.Execute(), Times.Once());
        }