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()); }
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()); }
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()); }
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()); }