public void HigherEducation_Test()
        {
            /*Context*/
            HigherEducationDAO higher_context = new HigherEducationDAO();
            AccountDAO account_context = new AccountDAO();

            /*Insert*/
            AccountDTO account = new AccountDTO();
            account.userName = "******";
            account.status = "active";
            account.password = "******";
            account.accountType = "admin";

            account_context.presist(account);

            HigherEducationDTO higherEdu = new HigherEducationDTO();
            higherEdu.userName = "******";
            higherEdu.country = "SA";
            higherEdu.educationType = "BTECH";
            higherEdu.industry = "Information Technology";
            higherEdu.institution = "CPUT";
            higherEdu.length = "four years";
            higherEdu.major = "Technical Programming";
            higherEdu.nqf = "7";
            higherEdu.province = "WP";
            higherEdu.town = "Cape Town";

            higher_context.presist(higherEdu);

            bool expected = true;
            bool actual;
            actual = higher_context.isFound("griddy", "Technical Programming");
            Assert.AreEqual(expected, actual);

            /*Update*/
            higherEdu.institution = "UWC";
            higher_context.merge(higherEdu);

            string expectedUpdate = "UWC";
            HigherEducationDTO contUpd = higher_context.find("griddy", "Technical Programming");
            Assert.AreEqual(expectedUpdate, contUpd.institution);

            /*Delete*/
            higher_context.removeByUserId("griddy", "Technical Programming");
            bool expectedDelete = false;
            bool actualDelete = higher_context.isFound("griddy", "Technical Programming");
            Assert.AreEqual(expectedDelete, actualDelete);

            account_context.removeByUserId("griddy");
        }
 public void doSave()
 {
     AccountService accountService = new AccountServiceImpl();
     if (isValid())
     {
         if (accountService.isUniqueHigherEducation(view.getUsername(), view.getMajor()))
         {
             HigherEducationDAO higherEducationDao = new HigherEducationDAO();
             higherEducationDao.presist(getHigherEducationDto());
             view.pageReload();
         }
         else
         {
             view.setMajorError("Error, this address type is already used. Enter another value");
         }
     }
     else
     {
         view.showFeedback("Error Field vlaues are not valid");
     }
 }