public void DeleteItemSuccessTest()
        {
            //Given
            var databseFactory =
                new EfCoreDatabaseFactoryBase <SharedLibraryContext>("SharedLibraryContext");


            using (var efCoreUnitOfWork = new EfCoreUnitOfWork <SharedLibraryContext>(databseFactory))
            {
                //Given
                var repository  = new EfCoreAccountRepository(databseFactory);
                var testAccount = repository.Save(AccountEntityHelper.CreateEfTestAccount());
                efCoreUnitOfWork.Commit();

                //When
                repository.Delete(testAccount);
                efCoreUnitOfWork.Commit();

                //Then
                var retrievedAccount = repository.GetById(testAccount.AccountId);
                Assert.IsNull(retrievedAccount, "The account was not deleted.");
            }
        }
        public void DeleteWithWhereClauseSuccessTest()
        {
            //Given
            var databseFactory =
                new EfCoreDatabaseFactoryBase <SharedLibraryContext>("SharedLibraryContext");

            using (var efCoreUnitOfWork = new EfCoreUnitOfWork <SharedLibraryContext>(databseFactory))
            {
                var repository    = new EfCoreAccountRepository(databseFactory);
                var listOfItems   = AccountEntityHelper.CreateEfCoreTestAccounts(3);
                var originalItems = repository.GetAll();
                repository.AddRange(listOfItems);
                var allNewItems = repository.GetAll().ToList();
                var itemsAdded  = allNewItems.Except(originalItems).ToList();

                //When
                var idsToDelete = itemsAdded.Select(x => x.AccountId);
                repository.Delete(x => idsToDelete.Contains(x.AccountId));
                efCoreUnitOfWork.Commit();

                //Then
                Assert.AreEqual(0, repository.GetAll().Except(allNewItems).Count(), "The items have not been deleted.");
            }
        }