internal static IFeatsEvaluationClient GivenClient( this FeatsEvaluationClientTests tests, IFeatsEvaluationConfiguration configuration, IEvaluationCache cache, IHttpClientFactory httpClientFactory) { return(new FeatsEvaluationClient( configuration, new TestLogger <FeatsEvaluationClient>(), httpClientFactory, cache)); }
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(); }