public async Task Get_conference_by_id() { var options = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(databaseName: "Get_conferences") .Options; await GetTestConferences(options); var id = 1; using (var context = new ApplicationDbContext(options)) { var controller = new ConferencesController(context); var result = await controller.GetConference(id); var okResult = Assert.IsType <OkObjectResult>(result); var response = Assert.IsType <ConferenceResponse>(okResult.Value); Assert.Equal("Conference1", response.Name); } }