Exemple #1
0
        public void RemoveBenefitTest_Plan()
        {
            Plan = mgr.GetPlanByType("Basic");
            var ChangeCtrl     = new ChangeBenefitsController();
            int prevCountRight = Plan.ServiceCosts.Count();

            ChangeCtrl.RemoveBenefit(Plan, "Inpatient");
            var TestResult_right = Plan.ServiceCosts.Count();

            var prevCountWrong = Plan.ServiceCosts.Count();

            ChangeCtrl.RemoveBenefit(null, "Inpatient");
            var TestResult_wrong = Plan.ServiceCosts.Count();

            Assert.AreEqual(prevCountRight - 1, TestResult_right);
            Assert.AreEqual(prevCountWrong, TestResult_wrong);
        }
Exemple #2
0
        public void RemoveBenefitTest()
        {
            Plan = mgr.GetPlanByType("Basic");
            var ChangeCtrl     = new ChangeBenefitsController();
            int prevCountRight = Plan.ServiceCosts.Count();

            ChangeCtrl.RemoveBenefit(Plan, "Inpatient");
            var TestResult_right = Plan.ServiceCosts.Count();

            var prevCountEmpty = Plan.ServiceCosts.Count();

            ChangeCtrl.RemoveBenefit(Plan, "");
            var TestResult_empty = Plan.ServiceCosts.Count();

            var prevCountNull = Plan.ServiceCosts.Count();

            ChangeCtrl.RemoveBenefit(Plan, null);
            var TestResult_null = Plan.ServiceCosts.Count();

            Assert.AreEqual(prevCountRight - 1, TestResult_right);
            Assert.AreEqual(prevCountEmpty, TestResult_empty);
            Assert.AreEqual(prevCountNull, TestResult_null);
        }
Exemple #3
0
 private void removeSubmit_Click(object sender, EventArgs e)
 {
     if (planList.SelectedItem != null && benefitList.SelectedItem != null)
     {
         var plan   = ChangeCtrl.GetPlan(planList.SelectedItem.ToString());
         var result = ChangeCtrl.RemoveBenefit(plan, benefitList.SelectedItem.ToString());
         if (result)
         {
             benefitList.Items.Remove(benefitList.SelectedItem);
             MessageBox.Show("Successfully Removed Benefit");
         }
         else
         {
             MessageBox.Show("Error Processing Request");
         }
     }
 }