Exemplo n.º 1
0
        public void TestNoItemsInList()
        {
            var statistics        = new List <CovidStatistic>();
            var monthlyCalculator = new MonthlyCovidStatisticsCalculator(statistics);

            Assert.ThrowsException <InvalidOperationException>(() => monthlyCalculator.FindAverageTotalTests(statistics));
        }
Exemplo n.º 2
0
        public void TestMultipleItemsInList()
        {
            var statistics = new List <CovidStatistic> {
                new CovidStatistic(new DateTime(2020, 10, 17), 100, 100, 100, 100),
                new CovidStatistic(new DateTime(2020, 10, 17), 300, 300, 100, 300)
            };
            var monthlyCalculator = new MonthlyCovidStatisticsCalculator(statistics);
            var result            = monthlyCalculator.FindAverageTotalTests(statistics);

            Assert.AreEqual(400, result);
        }