Example #1
0
 private ReportPackageSourceFile GetSourceFile(ReportPackageClass javaClass, ReportPackageSourceFile[] packageSourceFiles)
 {
     try
     {
         return(packageSourceFiles.First(file => file.Name == javaClass.SourceFilename));
     }
     catch (Exception e)
     {
         throw new EngineExceptionDto()
               {
                   Report = JavaEngineReportExceptionFactory
                            .GenerateReportForRawCoveragerSoureFile(javaClass)
               };
     }
 }
Example #2
0
        private ClassCoverageDto GetClassCoverageDto(string container, ReportPackageClass javaClass, ReportPackageSourceFile sourceFile)
        {
            var classCoverageDto = new ClassCoverageDto()
            {
                Name      = javaClass.Name,
                Container = container
            };

            if (javaClass.Method.Length > 0)
            {
                for (var index = 0; index < javaClass.Method.Length - 1; index++)
                {
                    var method     = javaClass.Method[index];
                    var nextMethod = javaClass.Method[index + 1];
                    classCoverageDto.MethodCoveragesDto
                    .Add(GetMethodCoverage(method, sourceFile, nextMethod.Line));
                }
                classCoverageDto.MethodCoveragesDto.Add(GetMethodCoverage(javaClass.Method[javaClass.Method.Length - 1], sourceFile));
            }

            return(classCoverageDto);
        }
Example #3
0
 public static string GenerateReportForRawCoveragerSoureFile(ReportPackageClass reportPackageClass)
 {
     return($"Failure to Find Source File in Raw Coverage Report.\n" +
            $"Report Package Source File Looking For: {reportPackageClass.SourceFilename}\n" +
            $"Report Package Name: {reportPackageClass.Name}");
 }