public void CountLoc_3() { var loc = new Loc(); var locResult = loc.CountLOC("/* Kommentar1 */ var a = 2; /* Kommentar2 */"); Assert.AreEqual(1, locResult.LinesOfCode); Assert.AreEqual(1, locResult.TotalLines); }
public void CountLOCTest() { var loc = new Loc(); var locResult = loc.CountLOC("1\r\n\r\n// …\r\n2 // …\r\n/* … */\r\n/* … */ 3\r\n\r\n/*\r\n…\r\n*/\r\n4\r\n5 /* …\r\n… */ 6"); Assert.AreEqual(6, locResult.LinesOfCode); Assert.AreEqual(13, locResult.TotalLines); }
public void CountLoc_2() { var loc = new Loc(); var locResult = loc.CountLOC("a = 0; /* Kommentar */ b = 2;"); Assert.AreEqual(1, locResult.LinesOfCode); Assert.AreEqual(1, locResult.TotalLines); }
public void Run() { var dir = environment.GetDir(); var loc = new Loc(); fileSystem.GetFiles(dir, filename => { var csSource = fileSystem.ReadContent(filename); var locResult = loc.CountLOC(csSource); console.WriteOutput(filename, locResult); } ); }