示例#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 EnsureMethodInvocationsForUpdateCommandAsync()
        {
            var service = new ServiceBaseMock(new PersonProxyStub());
            await service.UpdateCommand(new Person()).ExecuteAsync();

            service.OnUpdateCommandInitializationAsyncWasInvoked.ShouldBe(true);
            service.GetValidationResultsForUpdateWasInvoked.ShouldBe(true);
            service.GetBusinessRulesForUpdateAsyncWasInvoked.ShouldBe(true);
            service.GetAllErrorsForUpdateAsyncWasInvoked.ShouldBe(true);
            service.UpdateAsyncWasInvoked.ShouldBe(true);
        }