Search in sources :

Example 1 with QuestionType

use of org.survey.model.poll.QuestionType in project survey by markoniemi.

the class EditPollBeanTest method questionTypeChanged.

@Ignore("poll is attached and test does not represent the situation in runtime")
@Test
public void questionTypeChanged() {
    // addQuestion calls addPoll
    addQuestion();
    editPollBean.getPoll().getQuestions().get(0).setType(QuestionType.BOOLEAN);
    editPollBean.questionTypeChanged(0);
    String result = editPollBean.savePoll();
    Assert.assertEquals("editPollBean.savePoll returned an unexpected value", "pollSaved", result);
    Poll pollFromDatabase = pollService.findOne("poll");
    QuestionType type = pollFromDatabase.getQuestions().get(0).getType();
    Assert.assertEquals(QuestionType.BOOLEAN, type);
}
Also used : Poll(org.survey.model.poll.Poll) QuestionType(org.survey.model.poll.QuestionType) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

Ignore (org.junit.Ignore)1 Test (org.junit.Test)1 Poll (org.survey.model.poll.Poll)1 QuestionType (org.survey.model.poll.QuestionType)1