private List <PhysicianInvoice> FetchMedicalVendorInvoices(IRelationPredicateBucket bucket)
        {
            var medicalVendorInvoiceEntities     = new EntityCollection <PhysicianInvoiceEntity>();
            var medicalVendorInvoiceItemEntities = new EntityCollection <PhysicianInvoiceItemEntity>();

            using (var myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                myAdapter.FetchEntityCollection(medicalVendorInvoiceEntities, bucket);
                long[] medicalVendorInvoiceIds = medicalVendorInvoiceEntities.Select(i => i.PhysicianInvoiceId).ToArray();
                IRelationPredicateBucket medicalVendorInvoiceItemBucket = new RelationPredicateBucket
                                                                              (PhysicianInvoiceItemFields.PhysicianInvoiceId == medicalVendorInvoiceIds);
                myAdapter.FetchEntityCollection(medicalVendorInvoiceItemEntities, medicalVendorInvoiceItemBucket);
            }
            return(_medicalVendorInvoiceFactory.CreateMedicalVendorInvoices(medicalVendorInvoiceEntities,
                                                                            medicalVendorInvoiceItemEntities));
        }
 public void CreateMedicalVendorInvoicesThrowsExceptionWhenNullInvoiceEntityCollectionGiven()
 {
     _mocks.ReplayAll();
     _medicalVendorInvoiceFactory.CreateMedicalVendorInvoices(null, new EntityCollection <PhysicianInvoiceItemEntity>());
     _mocks.VerifyAll();
 }