public PhysicianInvoice CreateMedicalVendorInvoice(PhysicianInvoiceEntity medicalVendorInvoiceEntity,
                                                           EntityCollection <PhysicianInvoiceItemEntity> medicalVendorInvoiceItemEntities)
        {
            List <MedicalVendorInvoiceItem> medicalVendorInvoiceItems = _medicalVendorInvoiceItemFactory.
                                                                        CreateMedicalVendorInvoiceItems(medicalVendorInvoiceItemEntities);

            return(CreateMedicalVendorInvoice(medicalVendorInvoiceEntity, medicalVendorInvoiceItems));
        }
        public void CreateMedicalVendorInvoiceThrowsExceptionWhenGivenNullEntityAndValidItemCollection()
        {
            var medicalVendorInvoiceItemEntities = new EntityCollection <PhysicianInvoiceItemEntity>();

            Expect.Call(_medicalVendorInvoiceItemFactory.CreateMedicalVendorInvoiceItems(medicalVendorInvoiceItemEntities)).
            Return(new List <MedicalVendorInvoiceItem>());

            _mocks.ReplayAll();
            _medicalVendorInvoiceFactory.CreateMedicalVendorInvoice(null, medicalVendorInvoiceItemEntities);
            _mocks.VerifyAll();
        }
        // TODO: TEST Pass in start and end dates.
        public List <MedicalVendorInvoiceItem> GetMedicalVendorInvoiceItems(long medicalVendorMedicalVendorUserId,
                                                                            DateTime startDate, DateTime endDate)
        {
            var medicalVendorInvoiceItemRows = new MedicalVendorInvoiceItemTypedView();
            var bucket = new RelationPredicateBucket
                             (MedicalVendorInvoiceItemFields.OrganizationRoleUserId == medicalVendorMedicalVendorUserId);

            bucket.PredicateExpression.Add(MedicalVendorInvoiceItemFields.ReviewDate >= startDate);
            bucket.PredicateExpression.Add(MedicalVendorInvoiceItemFields.ReviewDate <= endDate.GetEndOfDay());
            using (var myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                myAdapter.FetchTypedView(medicalVendorInvoiceItemRows, bucket, false);
            }
            return(_medicalVendorInvoiceItemFactory.CreateMedicalVendorInvoiceItems(medicalVendorInvoiceItemRows));
        }
 public void CreateMedicalVendorInvoiceItemsThrowsExceptionWhenGivenNullDataRows()
 {
     _mocks.ReplayAll();
     _medicalVendorInvoiceItemFactory.CreateMedicalVendorInvoiceItems((MedicalVendorInvoiceItemTypedView)null);
     _mocks.VerifyAll();
 }