Example #1
0
        public void HealthProbeHttpClientFactory_CreateHttpClient()
        {
            // Set up the factory.
            var factory = new HealthProbeHttpClientFactory();

            // Create http client.
            var httpClient1 = factory.CreateHttpClient();
            var httpClient2 = factory.CreateHttpClient();
            var httpClient3 = new HttpClient();

            // Validation
            Assert.NotNull(httpClient1);
            Assert.NotNull(httpClient2);
            Assert.NotSame(httpClient2, httpClient1);
            Assert.IsType <HttpClient>(httpClient1);
        }
Example #2
0
        public void HealthProbeHttpClientFactory_CreateHttpClient()
        {
            // Set up the factory.
            var factory = new HealthProbeHttpClientFactory();

            // Create http client.
            var httpClient1 = factory.CreateHttpClient();
            var httpClient2 = factory.CreateHttpClient();
            var httpClient3 = new HttpClient();

            // Validation
            httpClient1.Should().NotBeNull();
            httpClient2.Should().NotBeNull();
            httpClient1.Should().NotBeSameAs(httpClient2);
            httpClient1.GetType().Should().Be(typeof(HttpClient));
        }