Example #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);
        }
        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);
        }