Example #1
0
        private static void PrintAllUserEmails()
        {
            var connectedTc = new RemoteTc()
                              .Connect(_ => _.ToHost(TeamCityHost).AsUser(Username, Password));

            connectedTc
            .GetAllUsers()
            .Select(u => connectedTc.GetUser(_ => _.Id(u.Id)))
            .ToList()
            .ForEach(u => Console.WriteLine(u.Email));
        }
Example #2
0
        public void GetUser_ByUsername()
        {
            // Arrange
            var teamCityCaller = CreateTeamCityCaller();

            var connectedTc = new RemoteTc().Connect(_ => _.AsGuest(), teamCityCaller);

            // Act
            User user = connectedTc.GetUser(_ => _.Username("boris.m"));

            // Assert
            A.CallTo(() => teamCityCaller.Get <User>(@"/app/rest/users/username:boris.m")).MustHaveHappened();
        }
Example #3
0
        public void GetUser_ByUsername()
        {
            // Arrange
            var teamCityCaller = CreateTeamCityCaller();

            var connectedTc = new RemoteTc().Connect(_ => _.AsGuest(), teamCityCaller);

            // Act
            User user = connectedTc.GetUser(_ => _.Username("boris.m"));

            // Assert
            A.CallTo(() => teamCityCaller.Get<User>(@"/app/rest/users/username:boris.m")).MustHaveHappened();
        }
Example #4
0
        private static void PrintAllUserEmails()
        {
            var connectedTc = new RemoteTc()
                .Connect(_ => _.ToHost(TeamCityHost).AsUser(Username, Password));

            connectedTc
                .GetAllUsers()
                .Select(u => connectedTc.GetUser(_ => _.Id(u.Id)))
                .ToList()
                .ForEach(u => Console.WriteLine(u.Email));
        }