public void VacancyKillerQuestionDAOConstructorTest() { /*Context*/ VacancyKillerQuestionDAO vacKill_context = new VacancyKillerQuestionDAO(); VacancyDAO vac_context = new VacancyDAO(); /*Insert*/ VacancyDTO vac = new VacancyDTO(); vac.department = "IS"; vac.description = "Web services"; vac.manager = "Tom"; vac.recruiter = "Thumi"; vac.site = "www.petrosa.co.za"; vac.startDate = new DateTime(2012, 10, 10); vac.endDate = new DateTime(2012, 12, 1); vac.description = "desktop support"; vac.title = "support technician"; vac.vacancyNumber = "1"; vac.viewCount = 10; vac.viewStatus = "published"; vac.status = "active"; vac_context.presist(vac); VacancyKillerQuestionDTO vacKill = new VacancyKillerQuestionDTO(); vacKill.vacancyNumber = "1"; vacKill.question = "Do you have a BTech"; vacKill.answer = "Yes"; Assert.AreEqual(vacKill_context.presist(vacKill), true); /*Update*/ vacKill.answer = "No"; vacKill_context.merge(vacKill); Assert.AreEqual(vacKill.answer, "No"); /*Delete*/ Assert.AreEqual(vacKill_context.removeByUserId("1", "Do you have a BTech"), true); vac_context.removeByUserId("1"); }
public void doUpdateQuestion() { if (isValid()) { VacancyKillerQuestionDAO employmentInfoDao = new VacancyKillerQuestionDAO(); employmentInfoDao.merge(getKillerQuestionDto()); view.showFeedback("Successfully updated"); } else { view.showFeedback("Error Field vlaues are not valid"); } }