public void GetWeatherTest_BadRequest_NoFile()
        {
            weatherMap = new WeatherMap();
            WeatherController weatherController = new WeatherController(weatherMap);

            weatherController.Request       = new HttpRequestMessage();
            weatherController.Configuration = new HttpConfiguration();

            HttpResponseMessage result = weatherController.GetWeather($"{new DirectoryInfo(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)).Parent.Parent.Parent.FullName}\\WeatherAPI\\NoFile.txt");

            Assert.AreEqual(result.StatusCode, System.Net.HttpStatusCode.BadRequest);
        }
Ejemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="weatherMap"></param>
 public WeatherController(IWeatherMap weatherMap)
 {
     WeatherMap = weatherMap;
 }
 //constructor to initialize readonly weather service object
 public WeatherMapController()
 {
     _WeatherMapService = new WeatherMap();
 }