public static IDataProvider <BookmakerDetailsDTO> BuildProvider(string apiKey) { var fetcher = string.IsNullOrEmpty(apiKey) ? new TestDataFetcher() : (IDataFetcher) new HttpDataFetcher(new HttpClient(), apiKey, new Deserializer <response>()); var url = string.IsNullOrEmpty(apiKey) ? TestData.RestXmlPath : "https://api.betradar.com/v1/users/"; var deserializer = new Deserializer <bookmaker_details>(); var mapperFactory = new BookmakerDetailsMapperFactory(); return(new DataProvider <bookmaker_details, BookmakerDetailsDTO>( url + InputXml, fetcher, deserializer, mapperFactory)); }
internal static IDataProvider <BookmakerDetailsDTO> BuildProvider(string apiKey) { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12; var fetcher = string.IsNullOrEmpty(apiKey) ? new TestDataFetcher() : (IDataFetcher) new HttpDataFetcher(new HttpClient(), apiKey, new Deserializer <response>()); var url = string.IsNullOrEmpty(apiKey) ? TestData.RestXmlPath : "https://api.betradar.com/v1/users/"; var deserializer = new Deserializer <bookmaker_details>(); var mapperFactory = new BookmakerDetailsMapperFactory(); return(new DataProvider <bookmaker_details, BookmakerDetailsDTO>( url + InputXml, fetcher, deserializer, mapperFactory)); }
public void Init() { var deserializer = new Deserializer <bookmaker_details>(); var dataFetcher = new TestDataFetcher(); var mapperFactory = new BookmakerDetailsMapperFactory(); var dataProvider = new DataProvider <bookmaker_details, BookmakerDetailsDTO>( TestData.RestXmlPath + InputXml, dataFetcher, deserializer, mapperFactory); _entity = dataProvider.GetDataAsync("", TestData.Culture.TwoLetterISOLanguageName).Result; object[] args = { dataProvider }; _bookmakerDetailsFetcher = LogInterceptorFactory.Create <BookmakerDetailsFetcher>(args, null, LoggerType.ClientInteraction); }