public void CommandExecuteCanHandleException() { //Arrange var internalClient = A.Fake<ICommandServiceClient>(); A.CallTo(() => internalClient.Execute(A<AddCustomer>.Ignored)).Throws ( new Exception("Exception Message") ); var client = new myCustomers.QuartetClientFactory.QuartetCommandServiceWrapper(internalClient); var command = new AddCustomer(); //Act client.Execute(command); }
public void CommandExecuteCanHandleFaultExceptionEmptyValidationMessage() { //Arrange var internalClient = A.Fake<ICommandServiceClient>(); A.CallTo(() => internalClient.Execute(A<AddCustomer>.Ignored)).Throws ( new FaultException<ValidationResult>(new ValidationResult { Errors = { } }, "Empty ValidationResult fault exception message") ); var client = new myCustomers.QuartetClientFactory.QuartetCommandServiceWrapper(internalClient); var command = new AddCustomer(); //Act client.Execute(command); }
public void CommandExecuteCanHandleFaultExceptionOneValidationMessage() { //Arrange var internalClient = A.Fake<ICommandServiceClient>(); A.CallTo(() => internalClient.Execute(A<AddCustomer>.Ignored)).Throws ( new FaultException<ValidationResult>(new ValidationResult { Errors = new string[] { "AddCustomer Failed validation due to reasons specified right here" } }, "One ValidationResult fault exception message") ); var client = new myCustomers.QuartetClientFactory.QuartetCommandServiceWrapper(internalClient); var command = new AddCustomer(); //Act client.Execute(command); }