Beispiel #1
0
        public void LoginTest()
        {
            bool failure;
            bool success;

            using (Jenkins jenkins = new Jenkins(this.host))
            {
                failure = jenkins.Login(this.login, "xxxxx");
                success = jenkins.Login(this.login, this.password);
            }

            Assert.IsFalse(failure, "failure");
            Assert.IsTrue(success, "success");
        }
        public void LoginLateTest()
        {
            // Arrange
            JenkinsModelHudson server = null;
            JenkinsModelUser   user   = null;

            // Act
            using (Jenkins jenkins = new Jenkins(this.host))
            {
                jenkins.Login(this.login, this.password);
                server = jenkins.GetServerAsync().Result;
                user   = jenkins.GetCurrentUserAsync().Result;
            }

            // Assert
            Assert.IsNotNull(server);
            Assert.IsNotNull(user);
            Assert.AreEqual(login, user.FullName, nameof(user.FullName));
        }