Beispiel #1
0
        public void WeatherDataParse_ShouldConvertToInt(string input, int[] expected)
        {
            var sut = new WeatherDataParser();

            var result = sut.Parse(input);

            Assert.Equal(expected, result);
        }
        /// <summary>
        /// Data Aggregation Sequence of WeatherModel
        /// </summary>
        public static void AggregateWeatherModel(string filePath)
        {
            WeatherDataParser   weatherDataParser = new WeatherDataParser(filePath);
            List <WeatherModel> weatherModels     = new List <WeatherModel>();

            foreach (List <int?> dataPoint in weatherDataParser.DataPoints)
            {
                WeatherModel model = weatherDataParser.ConvertDataToModel(dataPoint);
                if (model != null)
                {
                    weatherModels.Add(model);
                }
            }

            AddToDatabase <WeatherModel>(weatherModels, "weather-day");
        }