コード例 #1
0
        private HttpClient CreateApiClient(TestApplicabilityCheck applies)
        {
            var testApi = new PeakyService(targets =>
                                           targets.Add("staging",
                                                       "widgetapi",
                                                       new Uri("http://staging.widgets.com"),
                                                       dependencies =>
                                                       dependencies
                                                       .Register(() => applies)),
                                           testTypes: new[] { typeof(TestsConstrainedToTarget) });

            disposables.Add(testApi);

            return(testApi.CreateHttpClient());
        }
コード例 #2
0
 public TestsConstrainedToTarget(HttpClient httpClient, TestApplicabilityCheck applies)
 {
     this.httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
     this.applies    = applies;
 }