Ejemplo n.º 1
0
 protected void DeleteTempFile()
 {
     if (tempfile != null)
     {
         TempFileUtil.DeleteTempFile(tempfile);
     }
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }