Exemplo n.º 1
0
        public void ControllerReturnsCorrectNumberOfItems()
        {
            var mock = new Mock <ILogger <WeatherForecastController> >();

            ILogger <WeatherForecastController> logger = mock.Object;
            var options = Options.Create(new HereApiSettings {
                BaseUrl = "http://validurl.com"
            });

            var service = new HereApiService(new System.Net.Http.HttpClient(), options);

            var controller = new WeatherForecastController(logger, service);

            var result = controller.Get();

            Assert.AreEqual(5, result.Count());
        }
 public WeatherForecastController(ILogger <WeatherForecastController> logger, HereApiService hereApiService)
 {
     _logger         = logger;
     _hereApiService = hereApiService;
 }