Пример #1
0
        public static async Task <CloudBornWebTestRunContext> InitTestEnvironment(
            TestRunSettings testRunSettings,
            TrafficSource trafficSource)
        {
            // Init the environment only once in test run
            if (testRunContext != null)
            {
                return(testRunContext);
            }

            var connectionInfo = ConnectionInfoReader.GetConnectionInfo(testRunSettings.Environment);

            var webClientBuilder = new CloudBornWebClientBuilder(connectionInfo, trafficSource);

            CloudBornWebClient webClient = webClientBuilder.Create();

            await HttpClientUtils.WaitForService(
                async() =>
            {
                await webClient.GetHealth().ConfigureAwait(false);
            },
                connectionInfo.RetryOnFailedConnection).ConfigureAwait(false);

            testRunContext = new CloudBornWebTestRunContext(connectionInfo, webClient, webClientBuilder);

            return(testRunContext);
        }
 public CloudBornWebTestRunContext(ConnectionInfo connectionInfo, CloudBornWebClient client, CloudBornWebClientBuilder clientBuilder)
 {
     this.ConnectionInfo            = connectionInfo;
     this.CloudBornWebClient        = client;
     this.CloudBornWebClientBuilder = clientBuilder;
 }