public void Ensure_Method_Invocations_For_Update() { var service = new ServiceBaseMock(new PersonProxyStub()); var result = service.UpdateCommand(new Person()).Execute(); service.OnUpdateCommandInitializationWasInvoked.ShouldBe(true); service.GetValidationResultsForUpdateWasInvoked.ShouldBe(true); service.GetBusinessRulesForUpdateWasInvoked.ShouldBe(true); service.GetAllErrorsForUpdateWasInvoked.ShouldBe(true); service.UpdateWasInvoked.ShouldBe(true); }
public async Task EnsureMethodInvocationsForGetByIDCommandAsync() { var service = new ServiceBaseMock(new PersonProxyStub()); await service.GetByIDCommand(1).ExecuteAsync(); service.OnGetByIDCommandInitializationAsyncWasInvoked.ShouldBe(true); service.GetValidationResultsForGetByIDWasInvoked.ShouldBe(true); service.GetBusinessRulesForGetByIDAsyncWasInvoked.ShouldBe(true); service.GetAllErrorsForGetByIDAsyncWasInvoked.ShouldBe(true); service.GetByIDAsyncWasInvoked.ShouldBe(true); }
public async Task Ensure_Method_Invocations_For_InsertCommandAsync() { var service = new ServiceBaseMock(new PersonProxyStub()); await service.InsertCommand(new Person()).ExecuteAsync(); service.OnInsertCommandInitializationAsyncWasInvoked.ShouldBe(true); service.GetValidationResultsForInsertWasInvoked.ShouldBe(true); service.GetBusinessRulesForInsertAsyncWasInvoked.ShouldBe(true); service.GetAllErrorsForInsertAsyncWasInvoked.ShouldBe(true); service.InsertAsyncWasInvoked.ShouldBe(true); }
public void EnsureMethodInvocationsForGetByIDCommand() { var service = new ServiceBaseMock(new PersonProxyStub()); var result = service.GetByIDCommand(1).Execute(); service.OnGetByIDCommandInitializationWasInvoked.ShouldBe(true); service.GetValidationResultsForGetByIDWasInvoked.ShouldBe(true); service.GetBusinessRulesForGetByIDWasInvoked.ShouldBe(true); service.GetAllErrorsForGetByIDWasInvoked.ShouldBe(true); service.GetByIDWasInvoked.ShouldBe(true); }