private void iterateThroughEachMonth()
        {
            int monthOfFirstTest = this.getMonthValue(this.firstTestDate);

            for (int currentMonth = monthOfFirstTest; currentMonth <= 12; currentMonth++)
            {
                StackedStringArray     currentMonthCovidInformationList = new StackedStringArray();
                MonthlyCovidStatistics currentMonthlyCovidStatistics    = new MonthlyCovidStatistics(currentMonth, 2020);

                foreach (List <string> currentList in this.getStackedStringList())
                {
                    if (int.TryParse(currentList.ElementAt(Date), out _) &&
                        this.getMonthValue(currentList.ElementAt(Date)) == currentMonth &&
                        int.Parse(currentList.ElementAt(Date)) >= int.Parse(this.firstTestDate))
                    {
                        currentMonthCovidInformationList.addListToList(currentList);
                        currentMonthlyCovidStatistics.NumberOfDaysContainingData++;
                    }
                }

                if (currentMonthlyCovidStatistics.NumberOfDaysContainingData > 0)
                {
                    this.highestNumberOfPositiveTestsMonthly(currentMonthCovidInformationList, currentMonthlyCovidStatistics);
                    this.lowestNumberOfPositiveTestsMonthly(currentMonthCovidInformationList, currentMonthlyCovidStatistics);
                    this.highestNumberOfTotalTestsMonthly(currentMonthCovidInformationList, currentMonthlyCovidStatistics);
                    this.highestNumberOfTotalTestsMonthly(currentMonthCovidInformationList, currentMonthlyCovidStatistics);
                    this.lowestNumberOfTotalTestsMonthly(currentMonthCovidInformationList, currentMonthlyCovidStatistics);
                    this.averageNumberOfPositiveTestsPerDayMonthly(currentMonthCovidInformationList, currentMonthlyCovidStatistics);
                    this.averageNumberOfTotalTestsPerDayMonthly(currentMonthCovidInformationList, currentMonthlyCovidStatistics);
                    this.theProcessedMonthlyCovidStatisticses.Add(currentMonthlyCovidStatistics);
                }
            }
        }
        private void lowestNumberOfTotalTestsMonthly(StackedStringArray givenList, MonthlyCovidStatistics statisticsToWriteTo)
        {
            List <string> unformattedDateOfCurrentLowest = new List <string>();
            int           currentLowestNumberOfTests     = int.MaxValue;

            foreach (List <string> currentList in givenList.getListOfList())
            {
                if (int.Parse(currentList.ElementAt(PositiveIncrease)) + int.Parse(currentList.ElementAt(NegativeIncrease)) < currentLowestNumberOfTests)
                {
                    unformattedDateOfCurrentLowest.Clear();
                    unformattedDateOfCurrentLowest.Add(currentList.ElementAt(Date));
                    currentLowestNumberOfTests = int.Parse(currentList.ElementAt(PositiveIncrease)) + int.Parse(currentList.ElementAt(NegativeIncrease));
                }
                else if (int.Parse(currentList.ElementAt(PositiveIncrease)) +
                         int.Parse(currentList.ElementAt(NegativeIncrease)) < currentLowestNumberOfTests)
                {
                    unformattedDateOfCurrentLowest.Add(currentList.ElementAt(Date));
                }
            }

            if (currentLowestNumberOfTests == int.MaxValue)
            {
                statisticsToWriteTo.NumberLowestTotalTests = "-1";
            }
            else
            {
                statisticsToWriteTo.NumberLowestTotalTests = currentLowestNumberOfTests.ToString();
                statisticsToWriteTo.DateLowestTotalTests   = unformattedDateOfCurrentLowest;
            }
        }
 public CovidInformationInterpreter()
 {
     this.covidInformationList                 = new StackedStringArray();
     this.theProcessedCovidStatistics          = new CovidStatistics();
     this.theProcessedMonthlyCovidStatisticses = new List <MonthlyCovidStatistics>();
     this.firstPositiveTestDate                = "000000";
     this.firstTestDate = "000000";
 }
        private void averageNumberOfTotalTestsPerDayMonthly(StackedStringArray givenList, MonthlyCovidStatistics statisticsToWriteTo)
        {
            int totalNumberOfTotalTests = 0;
            int numberOfDaysCounted     = 0;

            foreach (List <string> currentList in givenList.getListOfList())
            {
                totalNumberOfTotalTests += int.Parse(currentList.ElementAt(PositiveIncrease)) + int.Parse(currentList.ElementAt(NegativeIncrease));
                numberOfDaysCounted++;
            }

            if (numberOfDaysCounted == 0)
            {
                statisticsToWriteTo.NumberAverageTotalTests = "-1";
            }
            else
            {
                double averageNumberOfTotalTests = Convert.ToDouble(totalNumberOfTotalTests) / Convert.ToDouble(numberOfDaysCounted);
                statisticsToWriteTo.NumberAverageTotalTests = averageNumberOfTotalTests.ToString(CultureInfo.InvariantCulture);
            }
        }