public async Task testConfirmed() { var options = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(databaseName: "testConfirmedStud") .Options; using (var context = new ApplicationDbContext(options)) { context.Students.Add(student1); context.Students.Add(student2); context.Users.Add(appU1); context.Users.Add(appU2); context.Users.Add(appU3); context.SaveChanges(); }; using (var context = new ApplicationDbContext(options)) { var service = new StudentController(context); var result = await service.Confirmed("1"); Assert.IsTrue(result); } }