public void CountMatchingLines() { var contents = File.ReadAllText(@"MATTIAS0_SIE4 2015-09-01 - 2016-08-31.SE.txt"); RegexMatchCounter counter = new RegexMatchCounter(); int rowCount = counter.CountMatchingLines(contents, "#VER"); Assert.AreEqual(165, rowCount); }
public void getNumberOfRowsOfFile() { const string content = @"C:\Users\Studerande\Source\Repos\2017_09_13_consolApp\SIEImportLib\MATTIAS0_SIE4 2015-09-01 - 2016-08-31.SE.txt"; string regexPattern = @"#VER"; RegexMatchCounter regexmatchcounter = new RegexMatchCounter(); int lineCount = regexmatchcounter.CountMatchingLines(content, regexPattern); Debug.WriteLine(lineCount); }