Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }