public void AsQueryable_CanCountItems() { var dbcontext = InMemoryContext.GetDbContext(); var repository = new EntityTableRepository <Movie>(dbcontext); var actual = repository.AsQueryable().Count(); Assert.AreEqual(TestData.Movies.Length, actual); }
public async Task DeleteAsync_DeletesValidData() { var dbcontext = InMemoryContext.GetDbContext(); var repository = new EntityTableRepository <Movie>(dbcontext); var testItem = RandomMovie(); await repository.DeleteAsync(testItem.Id); var actual = repository.AsQueryable().Count(); Assert.AreEqual(TestData.Movies.Length - 1, actual); }