public void AggregateService_UpdateDataFromOnlineServices()
        {
            IForecastRepository              forecastRepository            = new ForecastRepositoryMock();
            IObservationRepository           observationRepository         = new ObservationRepositoryMock();
            IForecastsServiceRepository      forecastsServiceRepository    = new ForecastsServiceRepositoryMock();
            IObservationsServiceRepository   observationsServiceRepository = new ObservationsServiceRepositoryMock();
            IWeatherForecastAggregateService aggregateService = new WeatherForecastAggregateService(
                forecastRepository,
                observationRepository,
                forecastsServiceRepository,
                observationsServiceRepository);

            aggregateService.UpdateDataFromOnlineServices();
        }
        public void AggregateService_GetCurrentDayForecastAccuracy()
        {
            IForecastRepository              forecastRepository            = new ForecastRepositoryMock();
            IObservationRepository           observationRepository         = new ObservationRepositoryMock();
            IForecastsServiceRepository      forecastsServiceRepository    = new ForecastsServiceRepositoryMock();
            IObservationsServiceRepository   observationsServiceRepository = new ObservationsServiceRepositoryMock();
            IWeatherForecastAggregateService aggregateService = new WeatherForecastAggregateService(
                forecastRepository,
                observationRepository,
                forecastsServiceRepository,
                observationsServiceRepository);

            Assert.IsTrue(aggregateService.GetCurrentDayForecastAccuracy() == 50,
                          "Accuracy calculation does not match");
        }
        public void AggregateService_GetCurrentTemperature()
        {
            IForecastRepository              forecastRepository            = new ForecastRepositoryMock();
            IObservationRepository           observationRepository         = new ObservationRepositoryMock();
            IForecastsServiceRepository      forecastsServiceRepository    = new ForecastsServiceRepositoryMock();
            IObservationsServiceRepository   observationsServiceRepository = new ObservationsServiceRepositoryMock();
            IWeatherForecastAggregateService aggregateService = new WeatherForecastAggregateService(
                forecastRepository,
                observationRepository,
                forecastsServiceRepository,
                observationsServiceRepository);

            Assert.IsTrue(aggregateService.GetCurrentTemperature() == 1,
                          "Current temperature does not match");
        }
        public void AggregateService_CurrentTemperatureMatchForecast()
        {
            IForecastRepository              forecastRepository            = new ForecastRepositoryMock();
            IObservationRepository           observationRepository         = new ObservationRepositoryMock();
            IForecastsServiceRepository      forecastsServiceRepository    = new ForecastsServiceRepositoryMock();
            IObservationsServiceRepository   observationsServiceRepository = new ObservationsServiceRepositoryMock();
            IWeatherForecastAggregateService aggregateService = new WeatherForecastAggregateService(
                forecastRepository,
                observationRepository,
                forecastsServiceRepository,
                observationsServiceRepository);

            Assert.IsTrue(aggregateService.CurrentTemperatureMatchForecast(new DateTime(2017, 1, 1, 12, 0, 0)),
                          "Current Day Temperature Status Invalid");
            Assert.IsFalse(aggregateService.CurrentTemperatureMatchForecast(new DateTime(2017, 1, 1, 23, 0, 0)),
                           "Current Night Temperature Status Invalid");
        }
        public void AggregateService_GetMinNightTemperatures()
        {
            IForecastRepository              forecastRepository            = new ForecastRepositoryMock();
            IObservationRepository           observationRepository         = new ObservationRepositoryMock();
            IForecastsServiceRepository      forecastsServiceRepository    = new ForecastsServiceRepositoryMock();
            IObservationsServiceRepository   observationsServiceRepository = new ObservationsServiceRepositoryMock();
            IWeatherForecastAggregateService aggregateService = new WeatherForecastAggregateService(
                forecastRepository,
                observationRepository,
                forecastsServiceRepository,
                observationsServiceRepository);
            var minNightTemp = aggregateService.GetMinNightTemperatures().GetEnumerator();

            minNightTemp.MoveNext();
            Assert.IsTrue(minNightTemp.Current == 1);
            minNightTemp.MoveNext();
            Assert.IsTrue(minNightTemp.Current == 2);
            minNightTemp.MoveNext();
            Assert.IsTrue(minNightTemp.Current == 3);
        }