public void GetAgeTest() { // Act var result = invoiceDetails.GetAge(new DateTime(1997, 7, 11)); // Assert Assert.AreEqual(22, result); }
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); }