public void JobDisableEnableTest() { // Arrange JenkinsModelFreeStyleProject freeStyleJobDisabled = null; JenkinsModelFreeStyleProject freeStyleJobEnabled = null; // Act using (Jenkins jenkins = new Jenkins(host, this.login, this.password)) { jenkins.DisableJobAsync("FreestyleDisableEnable", CancellationToken.None).Wait(); freeStyleJobDisabled = jenkins.GetJobAsync <JenkinsModelFreeStyleProject>("FreestyleDisableEnable").Result; jenkins.EnableJobAsync("FreestyleDisableEnable", CancellationToken.None).Wait(); freeStyleJobEnabled = jenkins.GetJobAsync <JenkinsModelFreeStyleProject>("FreestyleDisableEnable").Result; } // Assert Assert.IsNotNull(freeStyleJobDisabled, nameof(freeStyleJobDisabled)); Assert.IsTrue(freeStyleJobDisabled.IsDisabled, nameof(freeStyleJobDisabled.IsDisabled)); Assert.IsNotNull(freeStyleJobEnabled, nameof(freeStyleJobEnabled)); Assert.IsFalse(freeStyleJobEnabled.IsDisabled, nameof(freeStyleJobDisabled.IsDisabled)); }