public void InitTestClass() { try { ServiceFactory.InitializeServiceFactory(new ContainerConfiguration(ApplicationProfileType.TestFramework)); billingServiceBaseUrl = BillingApiTestSettings.Default.BillingServiceBaseUrlTestEnvironment; var asyncRestClientFactory = ServiceFactory.Instance.Create <IAsyncRestClientFactory>(); asyncRestClientBilling = asyncRestClientFactory.CreateClient(RestClientDefinitionBuilder.Build() .ForServiceUri(billingServiceBaseUrl) .Create()); Headers = new Dictionary <string, string>(); Headers.Add("Authorization", BillingApiTestSettings.Default.BillingServiceAuthorizationTokenTestEnvironment); request = new RestRequestSpecification(); request.Headers = Headers; request.ContentType = "application/json"; } catch (Exception ex) { log.Fatal(ex); } }
public QALibRestClient() { var asyncRestClientFactoryQALib = ServiceFactory.Instance.Create <IAsyncRestClientFactory>(); asyncRestClientQALib = asyncRestClientFactoryQALib.CreateClient(RestClientDefinitionBuilder.Build() .ForServiceUri($"{qalibBaseUrl}") .Create()); stateEngineResolver = ServiceFactory.Instance.Create <IEngineVersionResolver>(); }
public void Init() { try { var asyncRestClientFactory = ServiceFactory.Instance.Create <IAsyncRestClientFactory>(); asyncRestClientBilling = asyncRestClientFactory.CreateClient(RestClientDefinitionBuilder.Build() .ForServiceUri(billingServiceBaseUrl) .Create()); Headers = new Dictionary <string, string>(); Headers.Add("Authorization", authorizationTokenV2); paymentApiService = IocContainer.Resolve <IPaymentApi>(); paymentCollectionService = IocContainer.Resolve <IPaymentCollectionService>(); } catch (Exception ex) { log.Fatal(ex); } }
//public static void InitTestClass(TestContext context) public void InitTestClass() { try { ServiceFactory.InitializeServiceFactory(new ContainerConfiguration(ApplicationProfileType.TestFramework)); var asyncRestClientFactory = ServiceFactory.Instance.Create <IAsyncRestClientFactory>(); asyncRestClientZuora = asyncRestClientFactory.CreateClient(RestClientDefinitionBuilder.Build() .ForServiceUri(zuoraServiceBaseUrl) .Create()); request = new RestRequestSpecification(); Headers = new Dictionary <string, string>(); //Headers.Add("Authorization", authorizationTokenV2); serializer = ServiceFactory.Instance.Create <IJsonSerialization>(); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }