public void TestExtract2()
        {
            var extractor = new PropertyFieldExtractor<Person> { Names = new[] { "Id", "Name", "Parent.Parent.Name" } };
            var person = new Person
            {
                Id = 3,
                Name = "Person3",
                Parent = new Person
                {
                    Id = 2,
                    Name = "Person2",
                    Parent = new Person
                    {
                        Id = 1,
                        Name = "Person1"
                    }
                }
            };

            var result = extractor.Extract(person);

            Assert.IsNotNull(result);
            Assert.AreEqual(3, result.Length);
            Assert.AreEqual(3L, result[0]);
            Assert.AreEqual("Person3", result[1]);
            Assert.AreEqual("Person1", result[2]);
        }
        public void TestExtract3()
        {
            var extractor = new PropertyFieldExtractor<Person> { Names = new[] { "Id", "Name", "InvalidProperty" } };
            var person = new Person { Id = 1, Name = "Person1" };

            extractor.Extract(person);
        }
        public void TestAggregate()
        {
            var aggregator = new PassThroughLineAggregator<Person>();
            var person = new Person { Id = 1, Name = "Person 1" };

            var result = aggregator.Aggregate(person);

            Assert.AreEqual("[Person-Id(1),Name(Person 1)", result);
        }
        public void TestAggregate1()
        {
            var aggregator = new DelimitedLineAggregator<Person>
            {
                FieldExtractor = new PropertyFieldExtractor<Person> { Names = new[] { "Id", "Name" } }
            };
            var person = new Person { Id = 1, Name = "Person 1" };

            var result = aggregator.Aggregate(person);

            Assert.AreEqual("1,Person 1", result);
        }
        public void TestAggregate()
        {
            var aggregator = new FormatterLineAggregator<Person>
            {
                Format = "{0,-10}{1,-20}",
                FieldExtractor = new PropertyFieldExtractor<Person> { Names = new[] { "Id", "Name" } }
            };
            var person = new Person { Id = 1, Name = "Person 1"};

            var result = aggregator.Aggregate(person);

            Assert.AreEqual("1         Person 1            ", result);
        }