public void ShouldFailIfProcessTimesOut() { ExecutorShouldTimeOut(executor); var task = new FakeTask(executor); var result = IntegrationResultMother.CreateUnknown(); task.Run(result); mocks.VerifyAll(); Assert.That(result.Status, Is.EqualTo(IntegrationStatus.Failure)); Assert.That(result.TaskOutput, Does.Match("Command line '.*' timed out after \\d+ seconds")); }
public void ExecuteRunsFakeWithDefaults() { var workingDir = Path.Combine(DefaultWorkingDirectory, "WorkingDir"); var artefactDir = Path.Combine(DefaultWorkingDirectoryWithSpaces, "ArtifactsDir"); var buildFile = Path.Combine(DefaultWorkingDirectory, "ccnet.fsx"); var result = GenerateResultMock(workingDir, artefactDir); var task = new FakeTask(executor); task.BuildFile = buildFile; SetupExecutorMock(executor, "FAKE.exe", string.Concat(StringUtil.AutoDoubleQuoteString(buildFile), " ", "logfile=", StringUtil.AutoDoubleQuoteString(Path.Combine(artefactDir, string.Format(FakeTask.logFilename, task.LogFileId)))), workingDir, 600000); Mock.Get(result).SetupProperty(_result => _result.Status); result.Status = IntegrationStatus.Unknown; task.Run(result); mocks.Verify(); }