示例#1
0
        public void TestNoItemsInList()
        {
            var statistics        = new List <CovidStatistic>();
            var monthlyCalculator = new MonthlyCovidStatisticsCalculator(statistics);

            Assert.ThrowsException <InvalidOperationException>(() => monthlyCalculator.FindAveragePositiveTests(statistics));
        }
示例#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.FindAveragePositiveTests(statistics);

            Assert.AreEqual(200, result);
        }