public async Task GetPhoto() { // Arrange var options = new DbContextOptionsBuilder <MyAlbumDbContext>() .UseInMemoryDatabase(databaseName: "PhotoRepository_GetPhoto_MyAlbumDatabase") .Options; using (var context = new MyAlbumDbContext(options)) { Photo seedPhoto = SeedPhoto(context); PhotoRepository photoRepository = new PhotoRepository(context); // Act Photo result = await photoRepository.GetAsync(seedPhoto.Id); // Assert Assert.Equal(seedPhoto, result); } }