예제 #1
0
        public void PeopleTest()
        {
            JenkinsModelViewPeople people = null;

            using (Jenkins jenkins = new Jenkins(this.host, this.login, this.password))
            {
                people = jenkins.GetPeopleAsync().Result;
            }

            Assert.IsNotNull(people, "people");
            Assert.AreEqual("hudson.model.View$AsynchPeople$People", people.Class, "people.Class");

            Assert.IsNotNull(people.Users, "people.Users");

            var user = people.Users.Single(u => u.User.FullName == "User");

            Assert.IsNotNull(user, "user");
            Assert.AreEqual($"{this.host}/user/xx", user.User.AbsoluteUrl, "user.User.AbsoluteUrl");
            Assert.AreEqual("xx", user.User.FullName, "user.User.FullName");
        }
        public void PeopleTest()
        {
            // Arrange
            JenkinsModelViewPeople people = null;

            // Act
            using (Jenkins jenkins = new Jenkins(this.host, this.login, this.password))
            {
                people = jenkins.GetPeopleAsync().Result;
            }

            // Assert
            Assert.IsNotNull(people, nameof(people));
            Assert.AreEqual("hudson.model.View$People", people.Class, nameof(people.Class));

            Assert.IsNotNull(people.Users, nameof(people.Users));

            var user = people.Users.Single(u => u.User.FullName == "Tester");

            Assert.IsNotNull(user, nameof(user));
            Assert.AreEqual($"{this.host}user/tester", user.User.AbsoluteUrl, nameof(user.User.AbsoluteUrl));
            Assert.AreEqual("Tester", user.User.FullName, nameof(user.User.FullName));
        }