public void Read_Write_Nested_Property()
        {
            var source = new SourceClass
            {
                Value  = "Hello World",
                Nested = new SourceClass
                {
                    Value = "Hello Nested"
                }
            };
            var target = new TargetClass();

            var reader = new ObjectDataModelReader <SourceClass>(source);
            var writer = new ObjectDataModelWriter <TargetClass>(target);

            Assert.IsNotNull(reader.ReadField <SourceClass>(reader.Model[nameof(SourceClass.Nested)]));
            reader.EnterMember(reader.Model[nameof(SourceClass.Nested)]);
            writer.EnterMember(writer.Model[nameof(TargetClass.Nested)]);

            writer.WriteField(
                writer.Model[nameof(TargetClass.Value)],
                reader.ReadField <string>(reader.Model[nameof(SourceClass.Value)])
                );

            writer.LeaveMember();
            reader.LeaveMember();

            Assert.IsNotNull(target.Nested);
            Assert.AreEqual(source.Nested.Value, target.Nested.Value);
        }
        public void Read_Write_Enumerable()
        {
            var source = new SourceClass
            {
                Enumerable = new[]
                {
                    new SourceClass {
                        Value = "Value 1"
                    },
                    new SourceClass {
                        Value = "Value 2"
                    }
                }
            };
            var target = new TargetClass();

            var reader = new ObjectDataModelReader <SourceClass>(source);
            var writer = new ObjectDataModelWriter <TargetClass>(target);

            reader.EnterMember(reader.Model[nameof(SourceClass.Enumerable)]);
            reader.EnterEnumerable();
            writer.EnterMember(writer.Model[nameof(TargetClass.Enumerable)]);
            writer.EnterEnumerable();

            while (reader.MoveNext())
            {
                writer.MoveNext();
                writer.WriteField(
                    writer.Model[nameof(target.Value)],
                    reader.ReadField <string>(reader.Model[nameof(SourceClass.Value)])
                    );
            }

            writer.LeaveEnumerable();
            writer.LeaveMember();
            reader.LeaveEnumerable();
            reader.LeaveMember();

            Assert.IsNotNull(target.Enumerable);
            Assert.IsTrue(source.Enumerable.Select(q => q.Value).SequenceEqual(target.Enumerable.Select(q => q.Value)));
        }