//// getRequiredLogs return empty list when logsList is empty, public void getRequiredLogs_failure() { ParseLogFile parseLogFile = new ParseLogFile(); List <string> log = new List <string>(); List <string> level = new List <string>(); List <string> expect = parseLogFile.getRequiredLogs(log, level); Assert.Equal(0, expect.Count); }
//// getRequiredLogs return matching loglevel logs public void getRequiredLogs_success() { ParseLogFile parseLogFile = new ParseLogFile(); List <string> log = new List <string>(); log.Add("03/20 test INFO"); log.Add("04/20,test,error"); log.Add("05/20,test,error"); log.Add("05/20,test,WARN"); log.Add("05/20,test,trace"); List <string> level = new List <string>(); level.Add("info"); level.Add("warn"); List <string> expect = parseLogFile.getRequiredLogs(log, level); Assert.Equal(2, expect.Count); Assert.Equal(log[0], expect[0]); }