Пример #1
0
        public void GetTestListForInvoiceExistingTest()
        {
            // Act
            var  list = invoiceDetails.GetTestListForInvoice(45);//Existing diagnosis
            bool result;

            if (list.Count > 0)
            {
                result = true;
            }
            else
            {
                result = false;
            }
            // Assert
            Assert.IsTrue(result);
        }
Пример #2
0
        public InvoiceViewModel(int AppointmentId)
        {
            InvoiceDetails invoiceDetails = new InvoiceDetails();

            Diagnosis = invoiceDetails.GetDiagnosis(AppointmentId);
            Invoice   = invoiceDetails.GetInvoiceDetails(AppointmentId);
            if (Invoice == null)
            {
                invoiceDetails.GenerateInvoice(AppointmentId);
                Invoice = invoiceDetails.GetInvoiceDetails(AppointmentId);
            }
            Medicines = invoiceDetails.GetMedicineListForInvoice(Diagnosis.Id);
            Tests     = invoiceDetails.GetTestListForInvoice(Diagnosis.Id);

            this.DoctorFee = Invoice.TotalCost - (Medicines.Sum(t => t.Medicines.Cost * t.Quantity) + Tests.Sum(t => t.Tests.Cost));

            Age = invoiceDetails.GetAge(Invoice.Appointment.Patient.DateOfBirth);
        }