public void Should_Return_One_Line()
        {
            string sourceCode  = "/* well */ using System; /* machine */";
            int    linesOfCode = SourceCodeAnalysis.CountLinesOfCode(sourceCode);

            Assert.That(linesOfCode, Is.EqualTo(1));
        }
        public void Should_Return_Zero_Lines()
        {
            string sourceCode  = " // using System;";
            int    linesOfCode = SourceCodeAnalysis.CountLinesOfCode(sourceCode);

            Assert.That(linesOfCode, Is.EqualTo(0));
        }
コード例 #3
0
        public void Should_Return_Zero_Lines()
        {
            string sourceCode  = @"
/* using System;
It's the system.
This is a trivial using */";
            int    linesOfCode = SourceCodeAnalysis.CountLinesOfCode(sourceCode);

            Assert.That(linesOfCode, Is.EqualTo(0));
        }
        public void Should_Return_Two_Lines()
        {
            string sourceCode = @"
using System;
// this is a comment
using System.Linq;";

            int linesOfCode = SourceCodeAnalysis.CountLinesOfCode(sourceCode);

            Assert.That(linesOfCode, Is.EqualTo(2));
        }