public void Ensure_Method_Invocations_For_GetAllCommand() { var service = new ServiceBaseStub(new PersonProxyStub()); var result = service.GetAllCommand().Execute(); service.OnGetAllCommandInitializationWasInvoked.ShouldBe(true); service.OnGetAllCommandGetRulesWasInvoked.ShouldBe(true); service.OnGetAllCommandPerformValidationWasInvoked.ShouldBe(true); service.OnGetAllCommandValidationSuccessWasInvoked.ShouldBe(true); }
public async Task Ensure_Method_Invocations_For_GetAllCommandAsync() { var service = new ServiceBaseStub(new PersonProxyStub()); await service.GetAllCommand().ExecuteAsync(); service.OnGetAllCommandInitializationAsyncWasInvoked.ShouldBe(true); service.OnGetAllCommandGetRulesAsyncWasInvoked.ShouldBe(true); service.OnGetAllCommandPerformValidationAsyncWasInvoked.ShouldBe(true); service.OnGetAllCommandValidationSuccessAsyncWasInvoked.ShouldBe(true); }
public async Task UpdateCommand_Properly_Supports_ISupportValidation() { var service = new ServiceBaseStub(new PersonProxyStub()); var data = new Person(); var validatonResult = await service.UpdateCommand(data).ValidateAsync(); var executionResult = await validatonResult.CompleteCommandExecutionAsync(); executionResult.Success.ShouldBeTrue(); }