public void ExecutionResultIsNotSuccessfulWhenValidationIsNotSuccessful() { var mock = new MockCommand(); mock.Errors = new[] { new ValidationResult("Object doesn't exist") }; var result = mock.Execute(); result.Success.ShouldBe(false); }
public void ExecutionResultShouldContainErrorsWhenValidationIsNotSuccessful() { var mock = new MockCommand(); mock.Errors = new[] { new ValidationResult("Object doesn't exist") }; var result = mock.Execute(); result.Errors.Count().ShouldBe(1); }
public void OnExecuteIsNotInvokedWhenErrorsExist() { var mock = new MockCommand(); mock.Errors = new[] { new ValidationResult("Object doesn't exist") }; mock.Execute(); mock.OnExecuteWasInvoked.ShouldBe(false); }
public async Task OnExecuteAsyncIsNotInvokedWhenErrorsExist() { var mock = new MockCommand(); mock.Errors = new[] { new ValidationResult("Object doesn't exist") }; await mock.ExecuteAsync(); mock.OnExecuteAsyncWasInvoked.ShouldBe(false); }
public async Task OnExecuteAsyncIsInvokedWhenNoErrorsExist() { var mock = new MockCommand(); await mock.ExecuteAsync(); mock.OnExecuteAsyncWasInvoked.ShouldBe(true); }
public async Task OnInitializationAsyncIsInvoked() { var mock = new MockCommand(); await mock.ExecuteAsync(); mock.OnInitializationAsyncWasInvoked.ShouldBe(true); }
public void ExecutionResultShouldContainNoErrorsWhenValidationIsSuccessful() { var mock = new MockCommand(); var result = mock.Execute(); result.Errors.ShouldBe(null); }
public void ExecutionResultIsSuccessfulWhenValidationIsSuccessful() { var mock = new MockCommand(); var result = mock.Execute(); result.Success.ShouldBe(true); }
public void OnExecuteIsInvokedWhenNoErrorsExist() { var mock = new MockCommand(); var result = mock.Execute(); mock.OnExecuteWasInvoked.ShouldBe(true); }
public void OnInitializationIsInvoked() { var mock = new MockCommand(); var result = mock.Execute(); mock.OnInitializationWasInvoked.ShouldBe(true); }