public void ShouldFailBuildIfProcessTimesOut()
        {
            ProcessResult processResult = ProcessResultFixture.CreateTimedOutResult();

            mockProcessExecutor.ExpectAndReturn("Execute", processResult, new object[] { new IsAnything() });
            mytask.BuildTimeoutSeconds = 2;
            mytask.Executable          = POWERSHELL_PATH;
            mytask.Script = "MyScript.ps1";

            var result = IntegrationResult();

            mytask.Run(result);

            Assert.That(result.Status, Is.EqualTo(IntegrationStatus.Failure));
            Assert.That(result.TaskOutput, Is.StringMatching("Command line '.*' timed out after \\d+ seconds"));
        }
        public void ShouldFailBuildIfProcessTimesOut()
        {
            ProcessResult processResult = ProcessResultFixture.CreateTimedOutResult();

            mockProcessExecutor.Setup(executor => executor.Execute(It.IsAny <ProcessInfo>())).Returns(processResult).Verifiable();
            mytask.BuildTimeoutSeconds = 2;
            mytask.Executable          = POWERSHELL_PATH;
            mytask.Script = "MyScript.ps1";

            var result = IntegrationResult();

            mytask.Run(result);

            Assert.That(result.Status, Is.EqualTo(IntegrationStatus.Failure));
            Assert.That(result.TaskOutput, Does.Match("Command line '.*' timed out after \\d+ seconds"));
        }
Exemplo n.º 3
0
        public void ShouldFailIfProcessTimesOut()
        {
            var executorStub = mocks.StrictMock <ProcessExecutor>();

            SetupResult.For(executorStub.Execute(null)).IgnoreArguments().Return(ProcessResultFixture.CreateTimedOutResult());

            var task   = CreateTask(executorStub);
            var result = IntegrationResultMother.CreateUnknown();

            mocks.ReplayAll();
            task.Run(result);
            mocks.VerifyAll();

            Assert.That(result.Status, Is.EqualTo(IntegrationStatus.Failure));
            Assert.That(result.TaskOutput, Is.StringMatching("Command line '.*' timed out after \\d+ seconds"));
        }
        public void FailedIfProcessResultTimedout()
        {
            ProcessTaskResult result = new ProcessTaskResult(ProcessResultFixture.CreateTimedOutResult());

            Assert.IsFalse(result.CheckIfSuccess());
        }
Exemplo n.º 5
0
 private void ExecutorShouldTimeOut(ProcessExecutor executor)
 {
     Mock.Get(executor).Setup(_executor => _executor.Execute(It.IsAny <ProcessInfo>()))
     .Returns(ProcessResultFixture.CreateTimedOutResult()).Verifiable();
 }
Exemplo n.º 6
0
 private void ExecutorShouldTimeOut(ProcessExecutor executor)
 {
     Expect.Call(executor.Execute(null))
     .IgnoreArguments()
     .Return(ProcessResultFixture.CreateTimedOutResult());
 }
        public void ShouldFailIfProcessTimesOut()
        {
            var executorStub = mocks.Create <ProcessExecutor>(MockBehavior.Strict).Object;

            Mock.Get(executorStub).Setup(_executorStub => _executorStub.Execute(It.IsAny <ProcessInfo>())).Returns(ProcessResultFixture.CreateTimedOutResult());

            var task   = CreateTask(executorStub);
            var result = IntegrationResultMother.CreateUnknown();

            task.Run(result);
            mocks.Verify();

            Assert.That(result.Status, Is.EqualTo(IntegrationStatus.Failure));
            Assert.That(result.TaskOutput, Is.StringMatching("Command line '.*' timed out after \\d+ seconds"));
        }