示例#1
0
 public DoctorController(DrugstoreDbContext context,
                         UserManager <SystemUser> userManager,
                         GetPrescriptionsListUseCase getPrescriptions,
                         GetPrescriptionDetailsUseCase getPrescriptionDetails,
                         GetPrescriptionUseCase getPrescription,
                         GetMedicinesUseCase getMedicines,
                         GetPatientsUseCase getPatients,
                         DeletePrescriptionUseCase deletePrescription,
                         GetTreatmentHistoryUseCase getTreatmentHistory,
                         GetPrescriptionMedicinesUseCase getPrescriptionMedicines,
                         EditPrescriptionUseCase editPrescription,
                         AddPrescriptionUseCase addPrescription)
 {
     this.context                  = context;
     this.userManager              = userManager;
     this.getPrescription          = getPrescription;
     this.getMedicines             = getMedicines;
     this.getPatients              = getPatients;
     this.deletePrescription       = deletePrescription;
     this.getTreatmentHistory      = getTreatmentHistory;
     this.getPrescriptionMedicines = getPrescriptionMedicines;
     this.editPrescription         = editPrescription;
     this.addPrescription          = addPrescription;
     getPrescriptionsList          = getPrescriptions;
     this.getPrescriptionDetails   = getPrescriptionDetails;
 }
示例#2
0
 public PatientController(
     UserManager <SystemUser> userManager,
     DrugstoreDbContext context,
     GetTreatmentOverviewDataUseCase getTreatmentOverviewDataUseCase,
     GetPrescriptionDetailsUseCase getPrescriptionDetailsUseCase)
 {
     this.userManager = userManager;
     this.context     = context;
     this.getTreatmentOverviewDataUseCase = getTreatmentOverviewDataUseCase;
     this.getPrescriptionDetailsUseCase   = getPrescriptionDetailsUseCase;
 }
示例#3
0
        public void Should_Not_Get_Prescription_Details()
        {
            // given
            var patient      = context.Patients.First(p => p.SecondName == "One");
            var prescription = context.MedicalPrescriptions
                               .First(p => p.VerificationState == VerificationState.Accepted);
            var expectedResult = false;

            var loggerMock = new Mock <ILogger <GetPrescriptionDetailsUseCase> >();
            var useCase    = new GetPrescriptionDetailsUseCase(context, loggerMock.Object);

            // when
            var actualResult = useCase.Execute(patient.ID, prescription.ID);

            // then
            Assert.AreEqual(expectedResult, actualResult.Succes);
        }
示例#4
0
        public void Should_Get_Prescription_Details()
        {
            // given
            var patient      = context.Patients.First(p => p.SecondName == "One");
            var prescription = context.MedicalPrescriptions
                               .First(p => p.VerificationState == VerificationState.NotVerified);
            var expectedResult = new ResultViewModel <PrescriptionViewModel>
            {
                Data = Map <PrescriptionViewModel>(prescription)
            };

            var loggerMock = new Mock <ILogger <GetPrescriptionDetailsUseCase> >();
            var useCase    = new GetPrescriptionDetailsUseCase(context, loggerMock.Object);

            // when
            var actualResult = useCase.Execute(patient.ID, prescription.ID);

            // then
            Assert.AreEqual(expectedResult.Succes, actualResult.Succes);
            Assert.AreEqual(expectedResult.Data.Id, actualResult.Data.Id);
        }