public void Fees_Import() { FeeTestArgs args = CreateManyFees(1, 1, 1, MethodBase.GetCurrentMethod().Name); FeeCache cache = new FeeCache(); List <Fee> listImportedFees = cache.GetListFees(args.emptyFeeSchedNum, 0, 0); foreach (Fee fee in cache.GetListFees(_standardFeeSchedNum, 0, 0)) { string codeText = _listProcCodes.Where(x => x.CodeNum == fee.CodeNum).Select(x => x.ProcCode).FirstOrDefault(); listImportedFees = Fees.Import(codeText, fee.Amount, args.emptyFeeSchedNum, fee.ClinicNum, fee.ProvNum, listImportedFees); } Fees.InsertMany(listImportedFees); //Not able to use CollectionsAssert AreEqual because the FeeNums will be different for (int i = 0; i < listImportedFees.Count; i++) { Fee fee = listImportedFees[i]; Fee originalFee = cache.GetFee(fee.CodeNum, _standardFeeSchedNum, fee.ClinicNum, fee.ProvNum); try { Assert.AreEqual(originalFee.Amount, fee.Amount); } catch (Exception e) { throw new Exception("Import failed for fee at index :" + i + " with CodeNum=" + fee.CodeNum + " Inner:" + e.Message); } } }