public async Task GetAsyncAutocompleteItemsButNoneExistTestAsync() { //Given var repository = new EfCoreAsyncAccountRepository(_databaseFactory); //When var shouldBeEmpty = await repository.GetAutoCompleteItemsAsync(x => false, 1).ConfigureAwait(true); //Then Assert.IsFalse(shouldBeEmpty.Any(), "No item should have been found."); }
public async Task GetAsyncAutoCompleteItemsTestAsync() { //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 item = await repository.GetAutoCompleteItemsAsync(x => x.CompanyName.Contains(reference), 1).ConfigureAwait(true); //Then EqualityHelper.PropertyValuesAreEqual(item.First(), listOfItems[0], new[] { "AccountID", "LastModified", "LastModifiedBy", "Contacts" }); } }