public void SaveMedicalVendorInvoicePersistsValidInvoiceToDatabase()
        {
            Guid approvalGuid = Guid.NewGuid();

            var medicalVendorInvoiceItems = new List <MedicalVendorInvoiceItem>
            {
                new MedicalVendorInvoiceItem
                {
                    MedicalVendorInvoiceId           = 1,
                    MedicalVendorAmountEarned        = 3.23m,
                    OrganizationRoleUserAmountEarned = 5.33m,
                    CustomerId          = 6,
                    CustomerName        = "CustomerName",
                    EventDate           = new DateTime(2009, 3, 1),
                    EventId             = 34,
                    EventName           = "EventName",
                    PackageName         = "PackageName",
                    PodName             = "PodName",
                    ReviewDate          = new DateTime(2009, 6, 1),
                    EvaluationStartTime = new DateTime(2009, 6, 1),
                    EvaluationEndTime   = new DateTime(2009, 6, 2)
                }
            };

            var medicalVendorInvoice = new PhysicianInvoice
            {
                ApprovalGuid              = approvalGuid,
                ApprovalStatus            = ApprovalStatus.Unapproved,
                DateGenerated             = new DateTime(2009, 6, 1),
                MedicalVendorAddress      = "MedicalVendorAddress",
                MedicalVendorId           = VALID_MEDICAL_VENDOR_ID,
                MedicalVendorInvoiceItems = medicalVendorInvoiceItems,
                MedicalVendorName         = "MedicalVendorName",
                PhysicianId        = 1,
                PhysicianName      = "Bob",
                PaymentStatus      = PaymentStatus.Paid,
                PayPeriodEndDate   = new DateTime(2009, 6, 12),
                PayPeriodStartDate = new DateTime(2009, 6, 1)
            };

            _repository.SaveMedicalVendorInvoice(medicalVendorInvoice);

            PhysicianInvoice retrievedInvoice = _repository.GetMedicalVendorInvoice(approvalGuid);

            Assert.AreEqual(medicalVendorInvoice.ApprovalGuid, retrievedInvoice.ApprovalGuid);
            Assert.AreEqual(medicalVendorInvoice.PayPeriodEndDate, retrievedInvoice.PayPeriodEndDate);
            Assert.AreEqual(medicalVendorInvoice.PaymentStatus, retrievedInvoice.PaymentStatus);
        }
Beispiel #2
0
 public void SaveMedicalVendorInvoiceThrowsExceptionWhenGivenNullMedicalVendorInvoice()
 {
     _mocks.ReplayAll();
     _medicalVendorInvoiceRepository.SaveMedicalVendorInvoice(null);
     _mocks.VerifyAll();
 }