public void Can_clone_DtoWithObjectEnumerable() { var expected = new DtoWithObjectEnumerable() { Id = 1, Children = new[] { new DtoWithObjectEnumerable() { Id = 2, Children = new[] { new DtoWithObjectEnumerable() } } } }; var clone = Incubator.Clone(expected); Assert.AreNotSame(expected, clone); Assert.AreNotSame(expected.Children, clone.Children); Assert.AreEqual(expected.Children.First().Id, clone.Children.First().Id); Assert.AreEqual(expected.Children.First().Children.First().Id, clone.Children.First().Children.First().Id); }
public void Can_clone_DtoWithObjectEnumerable() { var expected = new DtoWithObjectEnumerable() { Id = 1, Children = new[] {new DtoWithObjectEnumerable() { Id = 2, Children = new[] {new DtoWithObjectEnumerable()} }} }; var clone = Incubator.Clone(expected); Assert.AreNotSame(expected, clone); Assert.AreNotSame(expected.Children, clone.Children); Assert.AreEqual(expected.Children.First().Id, clone.Children.First().Id); Assert.AreEqual(expected.Children.First().Children.First().Id, clone.Children.First().Children.First().Id); }