Esempio n. 1
0
        public async Task CurrentWeatherFahrenheitTest()
        {
            var widget = new CurrentWeatherWidgetV1
            {
                ApiKey = ApiKey,
                CityId = CityId,
                Scale  = TemperatureScale.Fahrenheit
            };

            var request = MetricQueryRequest.Create(widget);

            var handler = new CurrentWeatherMetricQuery();

            await handler.Handle(request, CancellationToken.None).ConfigureAwait(false);

            Assert.IsTrue(widget.ToString().Contains("°F"));
        }
        public async Task CurrentWeatherTest()
        {
            var widget = new CurrentWeatherWidgetV1
            {
                ApiKey = "56d878861dd420d0ba408011d6c8514d",
                CityId = "293397",
                Scale  = TemperatureScale.Celsius
            };

            var request = MetricQueryRequest.Create(widget);

            var handler = new CurrentWeatherMetricQuery();

            await handler.Handle(request, CancellationToken.None).ConfigureAwait(false);

            Assert.IsNotNull(widget.Value);
        }