Exemplo n.º 1
0
        public void ShouldUpdateResourceInTargetWhenUpdatedLocal()
        {
            using (var channel = new SynchronizationChannel<TestResource>(_testSource, _testTarget))
            {
                // Arrange
                _testResource = new TestResource(1) { CorrelationId = "1030" };
                _testTarget.Create(_testResource);
                var changedResource = _testResource.Copy();
                 changedResource.Description = "Changed";

                // Act
                channel.Open();
                _testSource.Create(changedResource);

                // Assert
                var actualtTestResource = _testTarget.Get(1);
                Assert.AreEqual(_testResource, actualtTestResource);
                Assert.AreEqual("Changed", actualtTestResource.Description);
            }
        }
Exemplo n.º 2
0
        public void ShouldUpdateResourceInTargetWhenUpdatedLocal()
        {
            using (var channel = new SynchronizationChannel <TestResource>(_testSource, _testTarget))
            {
                // Arrange
                _testResource = new TestResource(1)
                {
                    CorrelationId = "1030"
                };
                _testTarget.Create(_testResource);
                var changedResource = _testResource.Copy();
                changedResource.Description = "Changed";

                // Act
                channel.Open();
                _testSource.Create(changedResource);

                // Assert
                var actualtTestResource = _testTarget.Get(1);
                Assert.AreEqual(_testResource, actualtTestResource);
                Assert.AreEqual("Changed", actualtTestResource.Description);
            }
        }