public ReportText(MyDbContext context) { RegistrationInPharmacyService = new RegistrationInPharmacyService(context); DoctorOrderService = new DoctorOrderService(context); MedicineService = new MedicineForOrderingService(context); HelperFunctions = new HelperFunctions(); }
public void Generates_no_file_report() { DoctorOrderService doctorOrderService = new DoctorOrderService(Create_stub_repository_doctor_orders()); MedicineForOrderingService medicineForOrderingService = new MedicineForOrderingService(Create_stub_repository_medicine_orders()); DateOfOrder date = new DateOfOrder("10/09/2022", "25/10/2022"); string report = getReportText(date, doctorOrderService, medicineForOrderingService); Assert.Equal("", report); }
public String getReportText(DateOfOrder date) { StringBuilder stringBuilder = new StringBuilder(); int totalQuatity = 0; foreach (DoctorsOrder order in DoctorOrderService.GetAll()) { stringBuilder.Append(getText(date, order, stringBuilder)); totalQuatity += getQuantity(date, totalQuatity, order); } return(stringBuilder.Append("\n\n Total ordered quatity: " + totalQuatity + "\n").ToString()); }
private string getReportText(DateOfOrder date, DoctorOrderService doctorOrderService, MedicineForOrderingService medicineForOrderingService) { StringBuilder stringBuilder = new StringBuilder(); int totalQuatity = 0; int i = 1; foreach (DoctorsOrder order in doctorOrderService.GetAllForStub()) { stringBuilder.Append(getText(date, order, stringBuilder, medicineForOrderingService)); totalQuatity += 5; i++; } return(stringBuilder.ToString()); }