public async Task GetAsyncMAnyAsyncWithWhereClauseButNoneAsyncMatchSuccessTestAsync() { //Given var repository = new EfCoreAsyncAccountRepository(_databaseFactory); //When var shouldBeEmpty = await repository.GetManyAsync(x => false).ConfigureAwait(true); //Then Assert.IsFalse(shouldBeEmpty.Any(), "No item should have been found."); }
public async Task GetAsyncMAnyAsyncWithWhereClauseSuccessTestAsync() { //Given using (var efCoreAsyncUnitOfWork = new EfCoreAsyncUnitOfWork <SharedLibraryContext>(_databaseFactory)) { var repository = new EfCoreAsyncAccountRepository(_databaseFactory); var reference = "TestReference"; var listOfItems = GetAsyncItemsWithTwoItemsContainingTestReference(reference); await repository.AddRangeAsync(listOfItems).ConfigureAwait(true); await efCoreAsyncUnitOfWork.CommitAsync().ConfigureAwait(true); //When var items = await repository.GetManyAsync(x => x.CompanyName.Contains(reference)).ConfigureAwait(true); //Then EqualityHelper.AssertListsAreEqual(items.OrderBy(x => x.CompanyName).ToList(), listOfItems.OrderBy(x => x.CompanyName).Take(2).ToList(), new[] { "AccountID", "LastModified", "LastModifiedBy", "Contacts" }); } }