Пример #1
0
        public void UpdateCommand_Throws_DomainNotFoundException()
        {
            var proxy   = new PersonProxyStub();
            var service = new BusinessServiceBaseMock(proxy);

            service.UpdateCommand(new Person()).Execute();
        }
Пример #2
0
        public void Latency_Prone_Should_Not_Invoke_DataProxy_GetByID_On_Update()
        {
            var proxy   = new PersonProxyStub(isLatencyProne: true);
            var service = new BusinessServiceBaseMock(proxy);

            service.UpdateCommand(new Person()).Execute();
            proxy.GetByIDWasInvoked.ShouldBe(false);
        }
        public async Task DataProxy_UpdateAsync_Should_Be_Invoked()
        {
            var proxy   = new PersonProxyStub();
            var service = new BusinessServiceBaseMock(proxy);
            var result  = await service.UpdateCommand(new Person { ID = 1, ForeignKeyID = 0, Version = "1" }).ExecuteAsync();

            proxy.UpdateAsyncWasInvoked.ShouldBe(true);
        }
Пример #4
0
        public async Task LatencyProneShouldNotInvokeDataProxyGetByIDOnUpdateAsync()
        {
            var proxy   = new PersonProxyStub(isLatencyProne: true);
            var service = new BusinessServiceBaseMock(proxy);
            await service.UpdateCommand(new Person()).ExecuteAsync();

            proxy.GetByIDAsyncWasInvoked.ShouldBe(false);
        }
        public async Task UpdateCommandAsync_Reverts_PeasyForeignKey_Values()
        {
            var proxy   = new PersonProxyStub();
            var service = new BusinessServiceBaseMock(proxy);
            var result  = await service.UpdateCommand(new Person { ID = 1, ForeignKeyID = 0, Version = "1" }).ExecuteAsync();

            result.Value.ForeignKeyID.ShouldBe(null);
        }
        public async Task UpdateCommandAsync_Reverts_NonEditable_Values()
        {
            var proxy   = new PersonProxyStub();
            var service = new BusinessServiceBaseMock(proxy);
            var result  = await service.UpdateCommand(new Person { ID = 1, Name = "Frank Zappa", Version = "1" }).ExecuteAsync();

            result.Value.Name.ShouldBe("George Harrison");
        }
        public async Task Non_Latency_Prone_Should_Not_Invoke_DataProxy_GetByID_On_UpdateAsync()
        {
            var proxy   = new PersonProxyStub(isLatencyProne: false);
            var service = new BusinessServiceBaseMock(proxy);
            await service.UpdateCommand(new Person { ID = 1, Version = "1" }).ExecuteAsync();

            proxy.GetByIDAsyncWasInvoked.ShouldBe(true);
        }
Пример #8
0
 public async Task UpdateCommandAsync_Throws_ConcurrencyException()
 {
     var proxy   = new PersonProxyStub();
     var service = new BusinessServiceBaseMock(proxy);
     await service.UpdateCommand(new Person()
     {
         ID = 1, Version = "2"
     }).ExecuteAsync();
 }
        public void UpdateCommand_Throws_ConcurrencyException()
        {
            var proxy   = new PersonProxyStub();
            var service = new BusinessServiceBaseMock(proxy);

            service.UpdateCommand(new Person {
                ID = 1, Version = "2"
            }).Execute();
        }
Пример #10
0
        public void UpdateCommand_Reverts_Non_Editable_Values()
        {
            var proxy   = new PersonProxyStub();
            var service = new BusinessServiceBaseMock(proxy);
            var result  = service.UpdateCommand(new Person()
            {
                ID = 1, Name = "Frank Zappa", Version = "1"
            }).Execute();

            result.Value.Name.ShouldBe("George Harrison");
        }
Пример #11
0
        public void DataProxy_Update_Should_Be_Invoked()
        {
            var proxy   = new PersonProxyStub();
            var service = new BusinessServiceBaseMock(proxy);
            var result  = service.UpdateCommand(new Person()
            {
                ID = 1, ForeignKeyID = 0, Version = "1"
            }).Execute();

            proxy.UpdateWasInvoked.ShouldBe(true);
        }
Пример #12
0
        public void NonLatencyProneShouldNotInvokeDataProxyGetByIDOnUpdate()
        {
            var proxy   = new PersonProxyStub(isLatencyProne: false);
            var service = new BusinessServiceBaseMock(proxy);

            service.UpdateCommand(new Person()
            {
                ID = 1, Version = "1"
            }).Execute();
            proxy.GetByIDWasInvoked.ShouldBe(true);
        }
Пример #13
0
        public void UpdateCommandRevertsPeasyForeignKeyValues()
        {
            var proxy   = new PersonProxyStub();
            var service = new BusinessServiceBaseMock(proxy);
            var result  = service.UpdateCommand(new Person()
            {
                ID = 1, ForeignKeyID = 0, Version = "1"
            }).Execute();

            result.Value.ForeignKeyID.ShouldBe(null);
        }
Пример #14
0
 public async Task UpdateCommandAsync_Throws_DomainNotFoundException()
 {
     var proxy   = new PersonProxyStub();
     var service = new BusinessServiceBaseMock(proxy);
     await service.UpdateCommand(new Person()).ExecuteAsync();
 }