public void BuildDeleteTest() { // Arrange JenkinsModelFreeStyleProject freeStyleJob = null; int delBuildNum = 0; // Act using (Jenkins jenkins = new Jenkins(this.host, this.login, this.password)) { freeStyleJob = jenkins.GetJobAsync <JenkinsModelFreeStyleProject>("FreeStyle").Result; delBuildNum = freeStyleJob.FirstBuild.Number; jenkins.DeleteBuildAsync("FreeStyle", delBuildNum).Wait(); freeStyleJob = jenkins.GetJobAsync <JenkinsModelFreeStyleProject>("FreeStyle").Result; } // Assert Assert.IsNotNull(freeStyleJob, nameof(freeStyleJob)); Assert.IsTrue(delBuildNum < freeStyleJob.FirstBuild.Number); }
/// <summary> /// Delete Jenkins build. /// </summary> public void Delete() { JenkinsRun.Run(() => jenkins.DeleteBuildAsync(this.job.Name, this.modelRun.Number).Wait()); }