Ejemplo n.º 1
0
 public PostProcTestContext(TestContext testContext)
 {
     Config       = new AnalysisConfig();
     Settings     = TeamBuildSettings.CreateNonTeamBuildSettingsForTesting(TestUtils.CreateTestSpecificFolderWithSubPaths(testContext));
     Logger       = new TestLogger();
     TfsProcessor = new MockTfsProcessor(Logger);
     Scanner      = new MockSonarScanner(Logger);
 }
            public PostProcTestContext(TestContext testContext)
            {
                Config             = new AnalysisConfig();
                Settings           = TeamBuildSettings.CreateNonTeamBuildSettingsForTesting(TestUtils.CreateTestSpecificFolderWithSubPaths(testContext));
                Logger             = new TestLogger();
                TfsProcessor       = new MockTfsProcessor(Logger);
                Scanner            = new MockSonarScanner(Logger);
                TargetsUninstaller = new Mock <ITargetsUninstaller>();
                var callCount = 0;

                TargetsUninstaller
                .Setup(m => m.UninstallTargets())
                .Callback(() =>
                {
                    // Verify that the method was called maximum once
                    callCount.Should().Be(0, "Method should be called exactly once");
                    callCount++;
                });
            }
Ejemplo n.º 3
0
            public PostProcTestContext(TestContext testContext)
            {
                Config   = new AnalysisConfig();
                Settings = TeamBuildSettings.CreateNonTeamBuildSettingsForTesting(TestUtils.CreateTestSpecificFolder(testContext));

                Logger             = new TestLogger();
                CodeCoverage       = new MockCodeCoverageProcessor();
                Scanner            = new MockSonarScanner(Logger);
                ReportBuilder      = new MockSummaryReportBuilder();
                TargetsUninstaller = new Mock <ITargetsUninstaller>();
                var callCount = 0;

                TargetsUninstaller
                .Setup(m => m.UninstallTargets())
                .Callback(() =>
                {
                    // Verify that the method was called maximum once
                    callCount.Should().Be(0, "Method should be called exactly once");
                    callCount++;
                });

                CodeCoverage.InitialiseValueToReturn = true;
                CodeCoverage.ProcessValueToReturn    = true;
            }