コード例 #1
0
        //[TestMethod]
        public void JobRunPeningTest()
        {
            // Arrange
            JenkinsRunProgress longRun;
            JenkinsRunProgress progress;

            // Act
            using (Jenkins jenkins = new Jenkins(host, this.login, this.password))
            {
                longRun = jenkins.RunJobAsync("FreestyleRun1h", null, new JenkinsRunConfig()
                {
                    RunMode = JenkinsRunMode.Started
                }, null, CancellationToken.None).Result;

                progress = jenkins.RunJobAsync("Freestyle").Result;

                jenkins.StopJobAsync(longRun.JobName, longRun.BuildNum).Wait();
            }

            // Assert
            Assert.IsNotNull(progress, nameof(progress));
            Assert.AreEqual(JenkinsRunStatus.Stuck, progress.Status, nameof(progress.Status));
        }