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); }
private async Task <Exercise> GetExercise(DataContext context) { var repo = new ExerciseRepository(context); return(await repo.GetByName("Exercise 1", 1)); }