public void ExistTreatmentPlan()
        { //arrange
            ImpTreatmentPlan plan = new ImpTreatmentPlan(dbContext);

            //act
            //assert
            test = extentReport.StartTest("Exist TreatmentPlan Retest", "returns true if the patients is associated to a treatmentplan");
            Assert.IsTrue(plan.existPlan());
        }
Ejemplo n.º 2
0
        public void UserExist()
        { //arrange
            ImpTreatmentPlan plan = new ImpTreatmentPlan(dbContext);

            //act
            //assert
            test = extentReport.StartTest("Search User-fail test Retest", "searching a non existing user");
            Assert.IsTrue(plan.existPlan());
        }
        public void AddIntervention()
        { //arrange
            ImpTreatmentPlan plan = new ImpTreatmentPlan(dbContext);

            //act
            //assert
            test = extentReport.StartTest("Add new Intervention", "adds a new intervention to the existing treatmentplan");
            int start = dbContext.Interventions.ToList().Count;

            plan.AddIntervention();
            int end = dbContext.Interventions.ToList().Count;

            Assert.Greater(end, start);
        }
        public void DeleteIntervention_FailTest()
        { //arrange
            ImpTreatmentPlan plan = new ImpTreatmentPlan(dbContext);

            //act
            //assert
            test = extentReport.StartTest("Delete intervention -Fail test", "Test fails because the list of interventions  is empty");
            int start = dbContext.Interventions.ToList().Count;

            dbContext.Interventions.FirstOrDefault().Intervention_id = 1;
            plan.DeleteIntervention(1);
            int end = dbContext.Interventions.ToList().Count;

            Assert.GreaterOrEqual(end, start);
        }
        public void DeleteIntervention()
        { //arrange
            ImpTreatmentPlan plan = new ImpTreatmentPlan(dbContext);

            //act
            //assert
            test = extentReport.StartTest("Delete Intervention", "Assert true for successful delete");
            int start = dbContext.Interventions.ToList().Count;

            plan.AddIntervention();
            dbContext.Interventions.FirstOrDefault().Intervention_id = 1;
            plan.DeleteIntervention(1);
            int end = dbContext.Interventions.ToList().Count;

            Assert.GreaterOrEqual(end, start);
        }
Ejemplo n.º 6
0
 // GET: TreatmentPlans
 public TreatmentPlansController()
 {
     impTreatmentPlan = new ImpTreatmentPlan(db);
 }