public void Create_From_IEnumerable() { var collection = new[] { new MyClass { Name = "John Doe", Age = 30 }, new MyClass { Name = "Jane Doe", Age = 31 } }; CsvRow[] rows = CsvRow.From(collection, configure => configure .ReturnHeaderAsRow()); Assert.That(rows.Length, Is.EqualTo(3)); Assert.That(rows[0]["Name"], Is.EqualTo("Name")); Assert.That(rows[0]["Age"], Is.EqualTo("Age")); Assert.That(rows[1]["Name"], Is.EqualTo("John Doe")); Assert.That(rows[1]["Age"], Is.EqualTo("30")); Assert.That(rows[2]["Name"], Is.EqualTo("Jane Doe")); Assert.That(rows[2]["Age"], Is.EqualTo("31")); }