public void GetTeamCityConnectionDetails_Guest_ActAsGuestTrue()
        {
            // Arrange
            var teamCityConfigurationBuilder = new TeamCityConfigurationBuilder();
            // Act
            var teamCityConnectionDetails =
                teamCityConfigurationBuilder.ToHost("teamcity").AsGuest().GetTeamCityConnectionDetails();

            // Assert
            teamCityConnectionDetails.ActAsGuest.Should().BeTrue();
            teamCityConnectionDetails.TeamCityHost.Should().Be("teamcity");
        }
        public void GetTeamCityConnectionDetails_AsUser_ActAsGuestFalse()
        {
            // Arrange
            var teamCityConfigurationBuilder = new TeamCityConfigurationBuilder();
            // Act
            var teamCityConnectionDetails =
                teamCityConfigurationBuilder.ToHost("teamcity").AsUser("user", "pwd").GetTeamCityConnectionDetails();

            // Assert
            teamCityConnectionDetails.TeamCityHost.Should().Be("teamcity");
            teamCityConnectionDetails.ActAsGuest.Should().BeFalse();
            teamCityConnectionDetails.Username.Should().Be("user");
            teamCityConnectionDetails.Password.Should().Be("pwd");
        }
Exemple #3
0
 internal IConnectedTc Connect(Action<TeamCityConfigurationBuilder> connect, params object[] overrides)
 {
     var teamCityConfigurationBuilder = new TeamCityConfigurationBuilder();
     connect(teamCityConfigurationBuilder);
     if (overrides == null)
     {
         overrides = new object[] {teamCityConfigurationBuilder.GetITeamCityConnectionDetails()};
     }
     else
     {
         overrides = overrides.Concat(new[] { teamCityConfigurationBuilder.GetITeamCityConnectionDetails() }).ToArray();
     }
     var bootstrapper = new Bootstrapper(overrides);
     return bootstrapper.GetConnectedTc();
 }