internal static IFeatsEvaluationClient GivenClient(
     this FeatsEvaluationClientTests tests,
     IFeatsEvaluationConfiguration configuration,
     IEvaluationCache cache,
     IHttpClientFactory httpClientFactory)
 {
     return(new FeatsEvaluationClient(
                configuration,
                new TestLogger <FeatsEvaluationClient>(),
                httpClientFactory,
                cache));
 }
Exemple #2
0
 public FeatsEvaluationClient(
     IFeatsEvaluationConfiguration configuration,
     ILogger <FeatsEvaluationClient> logger,
     IHttpClientFactory httpClientFactory,
     IEvaluationCache cache)
 {
     this._logger             = logger;
     this._cache              = cache;
     this._client             = httpClientFactory.CreateClient("evaluations");
     this._client.BaseAddress = configuration.Host;
     this._client.Timeout     = configuration.RequestTimeout;
     this._client.DefaultRequestHeaders
     .Accept
     .Add(new MediaTypeWithQualityHeaderValue("application/json"));
     this._jsonOptions = new JsonSerializerOptions();
 }