Esempio n. 1
0
        public void UpdateCommand_Throws_DomainNotFoundException()
        {
            var proxy   = new PersonProxyStub();
            var service = new BusinessServiceBaseMock(proxy);

            service.UpdateCommand(new Person()).Execute();
        }
Esempio n. 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);
        }
        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);
        }
Esempio n. 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();
        }
Esempio n. 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");
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 14
0
 public async Task UpdateCommandAsync_Throws_DomainNotFoundException()
 {
     var proxy   = new PersonProxyStub();
     var service = new BusinessServiceBaseMock(proxy);
     await service.UpdateCommand(new Person()).ExecuteAsync();
 }