コード例 #1
0
        public void JobCreateDeleteXmlTest()
        {
            // Arrange
            XmlDocument config;
            JenkinsModelFreeStyleProject freeStyleJob = null;
            bool exists;

            // Act
            using (Jenkins jenkins = new Jenkins(host, this.login, this.password))
            {
                config = jenkins.GetJobConfigXmlAsync("Freestyle").Result;
                jenkins.CreateJobAsync("Dummy", config).Wait();
                freeStyleJob = jenkins.GetJobAsync <JenkinsModelFreeStyleProject>("Dummy").Result;
                jenkins.DeleteJobAsync("Dummy").Wait();
                exists = jenkins.JobExists("Dummy").Result;
            }

            // Assert
            Assert.IsNotNull(freeStyleJob, nameof(freeStyleJob));
            Assert.IsFalse(exists, nameof(exists));
        }