Exemple #1
0
 public void ExecutionResultIsNotSuccessfulWhenValidationIsNotSuccessful()
 {
     var mock = new MockCommand();
     mock.Errors = new[] { new ValidationResult("Object doesn't exist") };
     var result = mock.Execute();
     result.Success.ShouldBe(false); 
 }
Exemple #2
0
 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);
 }
Exemple #3
0
 public void OnExecuteIsNotInvokedWhenErrorsExist()
 {
     var mock = new MockCommand();
     mock.Errors = new[] { new ValidationResult("Object doesn't exist") };
     mock.Execute();
     mock.OnExecuteWasInvoked.ShouldBe(false);
 }
Exemple #4
0
 public async Task OnExecuteAsyncIsNotInvokedWhenErrorsExist()
 {
     var mock = new MockCommand();
     mock.Errors = new[] { new ValidationResult("Object doesn't exist") };
     await mock.ExecuteAsync();
     mock.OnExecuteAsyncWasInvoked.ShouldBe(false);
 }
Exemple #5
0
  public async Task OnExecuteAsyncIsInvokedWhenNoErrorsExist()
  {
      var mock = new MockCommand();
      await mock.ExecuteAsync();
      mock.OnExecuteAsyncWasInvoked.ShouldBe(true);
 } 
Exemple #6
0
 public async Task OnInitializationAsyncIsInvoked()
 {
     var mock = new MockCommand();
     await mock.ExecuteAsync();
     mock.OnInitializationAsyncWasInvoked.ShouldBe(true);
 }
Exemple #7
0
 public void ExecutionResultShouldContainNoErrorsWhenValidationIsSuccessful()
 {
     var mock = new MockCommand();
     var result = mock.Execute();
     result.Errors.ShouldBe(null);
 }
Exemple #8
0
 public void ExecutionResultIsSuccessfulWhenValidationIsSuccessful()
 {
     var mock = new MockCommand();
     var result = mock.Execute();
     result.Success.ShouldBe(true); 
 }
Exemple #9
0
 public void OnExecuteIsInvokedWhenNoErrorsExist()
 {
     var mock = new MockCommand();
     var result = mock.Execute();
     mock.OnExecuteWasInvoked.ShouldBe(true);
 }
Exemple #10
0
 public void OnInitializationIsInvoked()
 {
     var mock = new MockCommand();
     var result = mock.Execute();
     mock.OnInitializationWasInvoked.ShouldBe(true);
 }