public async void ListByCreator_ReturnsCorrectResources() { //Arrange var options = InMemoryUtils.ProduceFreshDbContextOptions(); var creator = ResourceUtils.VincentVanGogh; using (var context = new ApplicationDbContext(options)) { context.Resources.Add(ResourceUtils.TestSet.First()); context.SaveChanges(); } //Act using (var context = new ApplicationDbContext(options)) { ITrackEntityRepository <Resource, int, ApplicationUser, string> repo = new ResourcesRepository(context); var result = await repo.ListByCreator(creator); //Assert Assert.NotEmpty(result); Assert.IsAssignableFrom <IEnumerable <Resource> >(result); Assert.Single(result); } }