Example #1
0
        public void DirectoryResultHasCorrectTotalLines_GivenFileResults()
        {
            var resultLines   = 10;
            var fileResults   = MakeTestResults(10, "test/path", resultLines);
            var expectedLines = resultLines * fileResults.Count;

            var result = new DirectoryAnalysis("test/directory", fileResults);

            Assert.AreEqual(expectedLines, result.TotalLines);
        }
Example #2
0
        public void DirectoryResultHasCorrectFileTypeCalculations_GivenFileResults()
        {
            var fileResults = new List <FileAnalysis>();

            fileResults.AddRange(MakeTestResults(10, "test/path.extension1", 10));
            fileResults.AddRange(MakeTestResults(10, "test/path.extension2", 10));

            var result = new DirectoryAnalysis("test/directory", fileResults);

            var expectedLines = new Dictionary <string, int>
            {
                { "extension1", 100 },
                { "extension2", 100 }
            };

            Assert.AreEqual(expectedLines, result.LinesByExtension);
        }
Example #3
0
 public ProjectAnalysis(Project project, DirectoryAnalysis results)
 {
     Project = project;
     Results = results;
 }