public void Merge_WithNestedObject_MergesNestedProperties() { // Arrange var @base = new NestingDemo { Comment = "base comment", Nested = new Demo { Age = 20, Name = "Tim" } }; var @new = new NestingDemo { Comment = "new comment", Nested = new Demo { Age = 10 } }; var expected = new NestingDemo { Comment = "new comment", Nested = new Demo { Age = 10, Name = "Tim" } }; // Act @base.MergeWith(@new); // Assert Assert.AreEqual(expected, @base); }
public bool Equals(NestingDemo other) { return Comment == other.Comment && Equals(Nested, other.Nested); }
public bool Equals(NestingDemo other) { return(Comment == other.Comment && Equals(Nested, other.Nested)); }