Exemplo n.º 1
0
        public void UserTest()
        {
            JenkinsModelUser user = null;

            using (Jenkins jenkins = new Jenkins(this.host, this.login, this.password))
            {
                user = jenkins.GetUserAsync("User").Result;
            }

            Assert.IsNotNull(user, "user");
            Assert.AreEqual($"{this.host}/user/xx", user.AbsoluteUrl, "user.AbsoluteUrl");
            Assert.AreEqual(null, user.Description, "user.Description");
            Assert.AreEqual("User", user.FullName, "user.FullName");
            Assert.AreEqual("User", user.Id, "user.Id");
        }
        public void UserTest()
        {
            // Arrange
            JenkinsModelUser user = null;

            // Act
            using (Jenkins jenkins = new Jenkins(this.host, this.login, this.password))
            {
                user = jenkins.GetUserAsync("Tester").Result;
            }

            // Assert
            Assert.IsNotNull(user, nameof(user));

            Assert.AreEqual("hudson.model.User", user.Class, nameof(user.Class));
            Assert.AreEqual($"{this.host}user/tester", user.AbsoluteUrl, nameof(user.AbsoluteUrl));

            Assert.AreEqual("tester", user.Id, nameof(user.Id));
            Assert.AreEqual("Tester", user.FullName, nameof(user.FullName));
            Assert.AreEqual("Test User", user.Description, nameof(user.Description));
        }