public void Gradle_SingleModule_EnableCodeCoverageForJacocoWhenCodeCoverageIsAlreadyEnabled()
 {
     SetupMocks();
     LoadBuildFile(CodeCoverageTestConstants.BuildWithCCJacocoGradle);
     var enableCodeCoverage = new CodeCoverageEnablerForJacocoGradle();
     enableCodeCoverage.Initialize(_hc);
     var ccInputs = new Dictionary<string, string>();
     ccInputs.Add("buildfile", _sampleBuildFilePath);
     ccInputs.Add("classfilesdirectories", _classDirectories);
     ccInputs.Add("classfilter", _classFilter);
     ccInputs.Add("summaryfile", _summaryFile);
     ccInputs.Add("reportdirectory", _reportDirectory);
     ccInputs.Add("ismultimodule", "false");
     enableCodeCoverage.EnableCodeCoverage(_ec.Object, new CodeCoverageEnablerInputs(_ec.Object, "Gradle", ccInputs));
     VerifyJacocoCoverageForGradle(true);
     Assert.Equal(_warnings.Count, 0);
     Assert.Equal(_errors.Count, 0);
 }
 public void Gradle_EnableCodeCoverageForEmptyBuildFile()
 {
     SetupMocks();
     _sampleBuildFilePath = Path.Combine(Path.GetTempPath(), "buildEmpty.gradle");
     File.WriteAllText(_sampleBuildFilePath, string.Empty);
     var enableCodeCoverage = new CodeCoverageEnablerForJacocoGradle();
     enableCodeCoverage.Initialize(_hc);
     var ccInputs = new Dictionary<string, string>();
     ccInputs.Add("buildfile", _sampleBuildFilePath);
     ccInputs.Add("classfilesdirectories", _classDirectories);
     ccInputs.Add("classfilter", _classFilter);
     ccInputs.Add("summaryfile", _summaryFile);
     ccInputs.Add("reportdirectory", _reportDirectory);
     ccInputs.Add("ismultimodule", "false");
     Assert.Throws<InvalidOperationException>(() => enableCodeCoverage.EnableCodeCoverage(_ec.Object, new CodeCoverageEnablerInputs(_ec.Object, "Gradle", ccInputs)));
 }
 public void Gradle_EnableCodeCoverageWithNoReportDirectory()
 {
     SetupMocks();
     LoadBuildFile(CodeCoverageTestConstants.BuildGradle);
     var enableCodeCoverage = new CodeCoverageEnablerForJacocoGradle();
     enableCodeCoverage.Initialize(_hc);
     var ccInputs = new Dictionary<string, string>();
     ccInputs.Add("buildfile", _sampleBuildFilePath);
     ccInputs.Add("classfilesdirectories", _classDirectories);
     ccInputs.Add("classfilter", _classFilter);
     ccInputs.Add("summaryfile", _summaryFile);
     ccInputs.Add("ismultimodule", "true");
     Assert.Throws<ArgumentException>(() => enableCodeCoverage.EnableCodeCoverage(_ec.Object, new CodeCoverageEnablerInputs(_ec.Object, "Gradle", ccInputs)));
 }
 public void Gradle_EnableCodeCoverageForNotExistingBuildFile()
 {
     SetupMocks();
     _sampleBuildFilePath = Path.GetTempFileName();
     _sampleBuildFilePath = Path.ChangeExtension(_sampleBuildFilePath, ".gradle");
     var enableCodeCoverage = new CodeCoverageEnablerForJacocoGradle();
     enableCodeCoverage.Initialize(_hc);
     var ccInputs = new Dictionary<string, string>();
     ccInputs.Add("buildfile", _sampleBuildFilePath);
     ccInputs.Add("classfilesdirectories", _classDirectories);
     ccInputs.Add("classfilter", _classFilter);
     ccInputs.Add("summaryfile", _summaryFile);
     ccInputs.Add("reportdirectory", _reportDirectory);
     ccInputs.Add("ismultimodule", "false");
     Assert.Throws<FileNotFoundException>(() => enableCodeCoverage.EnableCodeCoverage(_ec.Object, new CodeCoverageEnablerInputs(_ec.Object, "Gradle", ccInputs)));
 }