public void Clone_ShouldCloneComplexObject()
        {
            var original = new ComplexObject {Name = "Foo", Children = new List<ComplexObject>() };
            original.Children.Add(new ComplexObject { Name = "Bar", Children = new List<ComplexObject>{new ComplexObject(), new ComplexObject()}});

            var copy = original.Clone<ComplexObject>();

            Assert.That(copy.Name, Is.EqualTo("Foo"));
            Assert.That(copy.Children.Count, Is.EqualTo(1));

            Assert.That(copy.Children[0].Name, Is.EqualTo("Bar"));
            Assert.That(copy.Children[0].Children.Count, Is.EqualTo(2));
        }
        public void Clone_ShouldCloneComplexObject()
        {
            var original = new ComplexObject {Name = "Foo" };
            var child = new ComplexObject { Name = "Bar" };
            child.Children.Add(new ComplexObject());
            child.Children.Add(new ComplexObject());
            original.Children.Add(child);

            var copy = original.Clone<ComplexObject>();

            Assert.That(copy.Name, Is.EqualTo("Foo"));
            Assert.That(copy.Children.Count, Is.EqualTo(1));

            Assert.That(copy.Children.First().Name, Is.EqualTo("Bar"));
            Assert.That(copy.Children.First().Children.Count, Is.EqualTo(2));
        }