Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
File: App.cs Project: kie0/CCD
        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);
            }

                                );
        }