Esempio n. 1
0
        public async void CountAllTest()
        {
            var options = getOptions(nameof(CountAllTest));

            await setup(options);

            var course = getCourse();

            using (var context = new CSAMSDbContext(options)) {
                // Initialize repository
                var repo = new CourseRepository(context);
                // Add actions
                var firstCount = await repo.CountAll();

                await repo.Add(course);

                var secondCount = await repo.CountAll();

                // Add assertions
                Assert.NotEqual(firstCount, secondCount);
                Assert.Equal(3, firstCount);
                Assert.Equal(4, secondCount);
            }
        }