Example #1
0
        private static OdsApiCredential ApiCredentialForEnvironment(CloudOdsEnvironment environment)
        {
            if (environment == CloudOdsEnvironment.Production)
            {
                return(new OdsApiCredential(AzureTestSettingsProvider.GetTestConfigVariable("ProductionApiKey"), AzureTestSettingsProvider.GetTestConfigVariable("ProductionApiSecret")));
            }

            throw new InvalidOperationException($"Cannot provide API credentials for '{environment.DisplayName}' environment");
        }
Example #2
0
        public Task <OdsApiConnectionInformation> GetConnectionInformationForEnvironment(CloudOdsEnvironment environment)
        {
            var apiCredentials = ApiCredentialForEnvironment(environment);

            if (environment == CloudOdsEnvironment.Production)
            {
                return(ConnectionInformationForEnvironment(AzureTestSettingsProvider.GetTestConfigVariable("ProductionApiUrl"), apiCredentials));
            }

            throw new InvalidOperationException($"Cannot provide connection information for '{environment.DisplayName}' environment");
        }