public void WriteReportCsvFile() { // create url report var urlReport = new UrlReport( new[] { new UrlReportRecord { Url = "/url" } }); // write url report var reportCsvFile = Path.Combine( TestData.TestData.CurrentDirectory, @"report.csv"); using (var reportCsvWriter = new ReportCsvWriter <UrlReportRecord>(reportCsvFile)) { reportCsvWriter.Write(urlReport); } // read url report lines var urlReportLines = File.ReadAllLines(reportCsvFile); // verify url report lines Assert.AreEqual(2, urlReportLines.Length); Assert.AreEqual( "\"Url\"", urlReportLines[0]); Assert.AreEqual( "\"/url\"", urlReportLines[1]); }
public virtual void WriteReportCsvFile( string path) { using (var reportCsvWriter = new ReportCsvWriter <T>( path)) { reportCsvWriter.Write(this); } }