public void SetUp()
        {
            string apiKey = Environment.GetEnvironmentVariable("FUNDA_API_KEY");

            var settings = new FundaApiClientSettings(apiKey);

            _apiClient = new FundaApiClient(new HttpClient(), new FundaApiUrlBuilder(), settings);
        }
예제 #2
0
        public Settings(
            int topSize,
            FundaApiClientSettings apiClientSettings,
            FundaApiSettings apiSettings,
            RetryPolicySettings retrySettings
            )
        {
            if (topSize <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(topSize));
            }

            TopSize           = topSize;
            ApiClientSettings = apiClientSettings ?? throw new ArgumentNullException(nameof(apiClientSettings));
            ApiSettings       = apiSettings ?? throw new ArgumentNullException(nameof(apiSettings));
            RetrySettings     = retrySettings ?? throw new ArgumentNullException(nameof(retrySettings));
        }
예제 #3
0
        private static Settings GetSettings()
        {
            string apiKey = Environment.GetEnvironmentVariable("FUNDA_API_KEY");

            var apiClientSettings = new FundaApiClientSettings(apiKey);

            const int BATCH_SIZE            = 25;
            const int MAX_PAGES_TO_RETRIEVE = 5000;

            var apiSettings = new FundaApiSettings(BATCH_SIZE, MAX_PAGES_TO_RETRIEVE);

            const float DELAY       = 2.0f;
            const float JITTER      = 0.5f;
            const int   RETRY_COUNT = 7;

            var retryPolicySettings = new RetryPolicySettings(DELAY, JITTER, RETRY_COUNT);

            const int TOP_SIZE = 10;

            return(new Settings(TOP_SIZE, apiClientSettings, apiSettings, retryPolicySettings));
        }