コード例 #1
0
        public async Task CanGetByName()
        {
            using var context = new DataContext(ContextOptions);
            var user = await GetUser(context);

            var exerciseRepo = new ExerciseRepository(context);
            var exerciseName = "Exercise test CanGetByName";

            await AddExercise(exerciseName, exerciseRepo, context);

            var exercisesReturned = await exerciseRepo.GetByName(exerciseName, user.Id);

            Assert.AreEqual(exerciseName, exercisesReturned.Name);
        }
コード例 #2
0
        private async Task <Exercise> GetExercise(DataContext context)
        {
            var repo = new ExerciseRepository(context);

            return(await repo.GetByName("Exercise 1", 1));
        }