//get empty list if logline passed is empty. public void getCsvCompliantContent_emptyLogLine() { List <ProcessLogcontent> processLogcontents = new List <ProcessLogcontent>(); ProcessLogcontent processLogcontent = new ProcessLogcontent(); List <string> logline = new List <string>(); processLogcontents = processLogcontent.getCsvCompliantContent(logline); Assert.Equal(0, processLogcontents.Count); }
//get list of object depending on given list of logline. public void getCsvCompliantContent() { List <ProcessLogcontent> processLogcontents = new List <ProcessLogcontent>(); ProcessLogcontent processLogcontent = new ProcessLogcontent(); List <string> logline = new List <string>(); logline.Add("05/22 01:02:33 error :...this is first log"); logline.Add("05/23 01:02:33 error :...this is second log"); logline.Add("05/24 01:02:33 error :...this is third log"); processLogcontents = processLogcontent.getCsvCompliantContent(logline); Assert.Equal(3, processLogcontents.Count); }
public void createCsvFile() { List <ProcessLogcontent> processLogcontents = new List <ProcessLogcontent>(); ProcessLogcontent processLogcontent = new ProcessLogcontent(); List <string> logline = new List <string>(); logline.Add("05/22 01:02:33 error :...this is first log"); logline.Add("05/23 01:02:33 error :...this is second log"); logline.Add("05/24 01:02:33 error :...this is third log"); processLogcontents = processLogcontent.getCsvCompliantContent(logline); CsvGeneration csvGeneration = new CsvGeneration(); csvGeneration.createCsvFile(processLogcontents, "test.csv"); Assert.True(File.Exists("test.csv")); File.Delete("test.csv"); }