protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); // read credentials var jsonFileHandler = new JsonFileHandler(); Globals.Credentials = jsonFileHandler.ReadJson <Credentials>(_credentialFile); }
public PlaceAutocompleteSearchProcessTest(ITestOutputHelper output) { _output = output; _logger = new NullLogger(); _testOutputClass = new OutputClass { Message = new List <string> { "test output" } }; var httpResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(JsonConvert.SerializeObject(_testOutputClass)) }; var httpMessageHanderStub = new HttpMessageHandlerStub((request, cancellationToken) => Task.FromResult(httpResponseMessage)); _httpClient = new HttpClient(httpMessageHanderStub); _restService = new RESTRequest <PlacesResponse, Dictionary <string, string> >(_httpClient); var jsonFileHandler = new JsonFileHandler(); Globals.Credentials = jsonFileHandler.ReadJson <Credentials>(_credentialFile); }