Esempio n. 1
0
        public void TestInitialize()
        {
            this.retryCounts = new TestRetryCounts();
            this.testServer  = TestUtils.CreateTestServer(
                services =>
            {
                services.AddSingleton <TestRetryCounts>(this.retryCounts);
                services.AddTransient <TestControllerForRetry>();
                services.AddMvc(
                    options =>
                {
                    options.EnableEndpointRouting = false;
                });
            });

            var httpClient       = this.testServer.CreateClient();
            var testServiceProxy = new HttpClientProxy <ITestServiceWithRetry>(
                "http://localhost",
                new HttpClientProxyOptions()
            {
                HttpClient = httpClient
            });

            this.testService = testServiceProxy.GetProxyObject();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="TestControllerForRetry"/> class.
 /// </summary>
 /// <param name="retryCounts">A type for collecting retry counts.</param>
 public TestControllerForRetry(TestRetryCounts retryCounts)
 {
     this.retryCounts = retryCounts;
 }