//TODO: SRE
        public MedicalVendorEarningAggregate GetMedicalVendorEarningAggregate(long physicianId,
                                                                              long eventCustomerResultId, bool isActive)
        {
            var medicalVendorEarningInfoTypedView = new MedicalVendorEarningInfoTypedView();
            IRelationPredicateBucket bucket       = new RelationPredicateBucket();

            bucket.PredicateExpression.Add(MedicalVendorEarningInfoFields.OrganizationRoleUserId ==
                                           physicianId);

            //bucket.PredicateExpression.Add(MedicalVendorEarningInfoFields.IsMvmvuserCustomerPayRateActive == isActive);

            using (var myAdapter = PersistenceLayer.GetDataAccessAdapter())
            {
                myAdapter.FetchTypedView(medicalVendorEarningInfoTypedView, bucket, false);
            }
            if (medicalVendorEarningInfoTypedView.Rows.Count == 0)
            {
                throw new ObjectNotFoundInPersistenceException <MedicalVendorMedicalVendorUser>(physicianId);
            }
            MedicalVendorEarningInfoRow medicalVendorEarningInfoRow = medicalVendorEarningInfoTypedView.Single();
            long medicalVendorUserEventTestLockId = GetMedicalVendorUserEventTestLockId(physicianId,
                                                                                        eventCustomerResultId, isActive);

            return(_medicalVendorEarningAggregateFactory.CreateMedicalVendorEarningAggregate(medicalVendorEarningInfoRow,
                                                                                             medicalVendorUserEventTestLockId));
        }
 public void CreateMedicalVendorEarningAggregateThrowsExceptionWhenNullRowGiven()
 {
     _medicalVendorEarningAggregateFactory.CreateMedicalVendorEarningAggregate(null, 0);
 }