Ejemplo n.º 1
0
        public void SaveMedicationFail()
        { //arrange
            ImpMedication medication = new ImpMedication(dbContext);
            //act

            DrugIssuance issuance = new DrugIssuance
            {
                IssuedDrug = dbContext.Drugs.ToList().FirstOrDefault()
                ,
                Medication_administration = dbContext.DrugAdministrations.FirstOrDefault(),
                Medication_dosage         = dbContext.DrugDosages.FirstOrDefault(),
                Medication_end_date       = DateTime.Now,
                Medication_start_date     = DateTime.Now,
                Medication_frequency      = dbContext.DrugFrequencies.ToList().FirstOrDefault(),
                Medication_manager        = new DrugManager {
                }
            };

            test = extentReport.StartTest("Save Medication Fail test", "Insert a new prescription to the Drug manager end > start");
            int start = dbContext.DrugInssuances.ToList().Count;

            medication.savePrescribedMedication(new List <DrugIssuance> {
                issuance
            });
            int end = dbContext.DrugInssuances.ToList().Count;

            Assert.Greater(start, end);

            //assert
        }
Ejemplo n.º 2
0
 public MedicationController()
 {
     impMedication = new ImpMedication(db);
 }