Exemplo n.º 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);
        }
Exemplo n.º 2
0
 public static async Task TestClassInitialize(TestContext context)
 {
     testRunContext = await CloudBornWebTestDriver.InitTestEnvironment(new TestRunSettings(context.Properties), TrafficSource.Test).ConfigureAwait(false);
 }