コード例 #1
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);
        }
コード例 #2
0
        public void Ensure_Method_Invocations_For_InsertCommand()
        {
            var service = new ServiceBaseMock(new PersonProxyStub());
            var result  = service.InsertCommand(new Person()).Execute();

            service.OnInsertCommandInitializationWasInvoked.ShouldBe(true);
            service.GetValidationResultsForInsertWasInvoked.ShouldBe(true);
            service.GetBusinessRulesForInsertWasInvoked.ShouldBe(true);
            service.GetAllErrorsForInsertWasInvoked.ShouldBe(true);
            service.InsertWasInvoked.ShouldBe(true);
        }