コード例 #1
0
 protected void DeleteTempFile()
 {
     if (tempfile != null)
     {
         TempFileUtil.DeleteTempFile(tempfile);
     }
 }
コード例 #2
0
 protected void SetUp()
 {
     CreateProcessExecutorMock(GendarmeTask.defaultExecutable);
     result                   = IntegrationResult();
     result.Label             = "1.0";
     result.ArtifactDirectory = Path.GetTempPath();
     logfile                  = Path.Combine(result.ArtifactDirectory, GendarmeTask.logFilename);
     TempFileUtil.DeleteTempFile(logfile);
     task = new GendarmeTask((ProcessExecutor)mockProcessExecutor.MockInstance);
 }
コード例 #3
0
        protected void SetUp()
        {
            var shadowCopier = mocks.Create <IShadowCopier>().Object;

            Mock.Get(shadowCopier).Setup(_shadowCopier => _shadowCopier.RetrieveFilePath(defaultLogger)).Returns(defaultLogger);

            var executionEnvironment = mocks.Create <IExecutionEnvironment>().Object;

            Mock.Get(executionEnvironment).SetupGet(_executionEnvironment => _executionEnvironment.IsRunningOnWindows).Returns(true);
            Mock.Get(executionEnvironment).SetupGet(_executionEnvironment => _executionEnvironment.RuntimeDirectory).Returns(RuntimeEnvironment.GetRuntimeDirectory());

            CreateProcessExecutorMock(Path.Combine(RuntimeEnvironment.GetRuntimeDirectory(), "MSBuild.exe"));
            task = new MsBuildTask((ProcessExecutor)mockProcessExecutor.Object, executionEnvironment, shadowCopier);

            result                   = IntegrationResult();
            result.Label             = "1.0";
            result.ArtifactDirectory = DefaultWorkingDirectory;

            logfile = Path.Combine(result.ArtifactDirectory, MsBuildTask.LogFilename);
            TempFileUtil.DeleteTempFile(logfile);
        }
コード例 #4
0
        protected void SetUp()
        {
            var shadowCopier = mocks.DynamicMock <IShadowCopier>();

            SetupResult.For(shadowCopier.RetrieveFilePath(defaultLogger)).Return(defaultLogger);

            var executionEnvironment = mocks.DynamicMock <IExecutionEnvironment>();

            SetupResult.For(executionEnvironment.IsRunningOnWindows).Return(true);
            SetupResult.For(executionEnvironment.RuntimeDirectory).Return(RuntimeEnvironment.GetRuntimeDirectory());

            mocks.ReplayAll();


            CreateProcessExecutorMock(Path.Combine(RuntimeEnvironment.GetRuntimeDirectory(), "MSBuild.exe"));
            task = new MsBuildTask((ProcessExecutor)mockProcessExecutor.MockInstance, executionEnvironment, shadowCopier);

            result                   = IntegrationResult();
            result.Label             = "1.0";
            result.ArtifactDirectory = DefaultWorkingDirectory;
            logfile                  = Path.Combine(result.ArtifactDirectory, MsBuildTask.LogFilename);
            TempFileUtil.DeleteTempFile(logfile);
        }