Esempio n. 1
0
        public async Task AverageAsync_Student_CalculatesAverageCorrectly()
        {
            using var context = new UniversityContext(builder.Options);
            var repository = new GradeRepository(context);
            // From UniversityContext OnModelCreating
            var initialNumber = 3;

            var count = await repository.AverageAsync(grade => grade.StudentId == 3, grade => grade.Mark);

            Assert.That(count, Is.EqualTo(initialNumber));
        }