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)); }
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(); }
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(); }