public void SlocTester(string treeKey)
        {
            SyntaxTree tree = _treeDictionary[treeKey];

            int result = int.Parse(treeKey.Split('-')[0]);

            var classDeclaration = (ClassDeclarationSyntax)tree.GetRoot().ChildNodes().Single();

            Assert.IsTrue(SourceLinesOfCode.GetCount(classDeclaration) == result);
        }
Beispiel #2
0
//        [TestCase("0-CDTree1")]
//        [TestCase("3-CDTree1")]
//        [TestCase("1-CDTree2")]
//        [TestCase("1-CDTree3")]
//        [TestCase("2-CDTree4")]
//        [TestCase("2-CDTree5")]
        public void CdTester(string treeKey)
        {
            SyntaxTree tree = _treeDictionary[treeKey];

            int result = int.Parse(treeKey.Split("-")[0]);

            var classDeclaration = (ClassDeclarationSyntax)tree.GetRoot().ChildNodes().Single();
            int sloc             = SourceLinesOfCode.GetCount(classDeclaration);
            int cd = CommentDensity.GetCount(classDeclaration, sloc);

            Assert.IsTrue(cd == result);
        }