Exemplo n.º 1
0
        public void Merge_WithNestedObject_TakesParentSpecificDefaultsIntoAccount()
        {
            // Arrange
            var @base = new NestingDemoWithCustomizedDefaultAge
            {
                Nested = new Demo
                {
                    Age = 0
                }
            };
            var @new     = new NestingDemoWithCustomizedDefaultAge {
            };
            var expected = new NestingDemoWithCustomizedDefaultAge
            {
                Nested = new Demo
                {
                    Age = 0,
                }
            };

            // Act
            @base.MergeWith(@new);

            // Assert
            Assert.AreEqual(expected, @base);
        }
Exemplo n.º 2
0
        public void Merge_WithNestedObject_TakesParentSpecificDefaultsIntoAccount()
        {
            // Arrange
            var @base = new NestingDemoWithCustomizedDefaultAge
            {
                Nested = new Demo
                {
                    Age = 0
                }
            };
            var @new = new NestingDemoWithCustomizedDefaultAge{};
            var expected = new NestingDemoWithCustomizedDefaultAge
            {
                Nested = new Demo
                {
                    Age = 0,
                }
            };

            // Act
            @base.MergeWith(@new);

            // Assert
            Assert.AreEqual(expected, @base);
        }