public void TestReflectionEntityMergerWhenMergeNullOrDefault() { var sample = new MergeOptionSample { IntValue = 1, NullableIntValue = 2, Text = "abc", Array2 = new string[] { "a" }, Nested = new MergeOptionSample { IntValue = 1, NullableIntValue = 2, Text = null, Nested = new MergeOptionSample(), } }; var overrides = new MergeOptionSample { IntValue = 10, Array1 = new int[] { 2 }, Nested = new MergeOptionSample { NullableIntValue = 22, Text = "Wow!", } }; new MergerFacade( new KeyedListMerger( new ReflectionEntityMerger())) .Merge(ref sample, overrides); Assert.Equal(10, sample.IntValue); Assert.Equal(2, sample.NullableIntValue); Assert.Null(sample.Text); Assert.Same(overrides.Array1, sample.Array1); Assert.Null(sample.Array2); Assert.Equal(0, sample.Nested.IntValue); Assert.Equal(2, sample.Nested.NullableIntValue); Assert.Equal("Wow!", sample.Nested.Text); Assert.Null(sample.Nested.Nested); }