/// <summary> /// Initializes a new instance of the <see cref = "TeamCityClient" /> class. /// </summary> /// <param name = "accessConfiguration">The access configuration.</param> public TeamCityClient(ITeamCityAccessConfiguration accessConfiguration) { if (accessConfiguration == null) throw new ArgumentNullException("accessConfiguration"); this.accessConfiguration = accessConfiguration; this.connection = new TeamCityConnection(this.accessConfiguration); }
private void TestConnection() { Log.Information("=> TeamCityConfigurationViewModel.TestConnection"); isTesting = true; IsEditable = false; IsTestSuccessful = null; var connection = new TeamCityConnection(teamCityDevice); try { IsTestSuccessful = connection.GetProjects() != null; } catch (Exception) { IsTestSuccessful = false; } finally { isTesting = false; IsEditable = true; Log.Information("TeamCity connection test " + (IsTestSuccessful.HasValue && IsTestSuccessful.Value ? "succeeded" : "failed")); } }