예제 #1
0
        public TeamCityClient(
            ITeamCityRestClientFactory teamCityRestClientFactory, IOptionsSnapshot <ConnectionOptions> connectionOptionsSnapshot,
            IResponseValidator responseValidator, ITeamCityRequestPreparer teamCityRequestPreparer)
        {
            if (connectionOptionsSnapshot == null)
            {
                throw new ArgumentNullException(nameof(connectionOptionsSnapshot));
            }
            var connectionOptions = connectionOptionsSnapshot.Value;

            _responseValidator       = responseValidator ?? throw new ArgumentNullException(nameof(responseValidator));
            _teamCityRequestPreparer = teamCityRequestPreparer ?? throw new ArgumentNullException(nameof(teamCityRequestPreparer));
            _client = teamCityRestClientFactory?.Create(connectionOptions) ?? throw new ArgumentNullException(nameof(teamCityRestClientFactory));
        }
예제 #2
0
 public TeamCityClient(ITeamCityRestClientFactory teamCityRestClientFactory, IConnectionSettings connectionSettings,
                       IResponseValidator responseValidator, ITeamCityRequestPreparer teamCityRequestPreparer)
 {
     if (teamCityRestClientFactory == null)
     {
         throw new ArgumentNullException(nameof(teamCityRestClientFactory));
     }
     if (connectionSettings == null)
     {
         throw new ArgumentNullException(nameof(connectionSettings));
     }
     if (responseValidator == null)
     {
         throw new ArgumentNullException(nameof(responseValidator));
     }
     if (teamCityRequestPreparer == null)
     {
         throw new ArgumentNullException(nameof(teamCityRequestPreparer));
     }
     _responseValidator       = responseValidator;
     _teamCityRequestPreparer = teamCityRequestPreparer;
     _client = teamCityRestClientFactory.Create(connectionSettings);
 }