示例#1
0
 /** Test of setDateCreated method, of class Question. */
 @Test
 public void testSetDateCreated() {
   System.out.println("setDateCreated");
   ObjectProperty<LocalDate> inDateCreated = null;
   Question instance = new Question();
   instance.setDateCreated(inDateCreated);
   // TODO review the generated test code and remove the default call to fail.
   fail("The test case is a prototype.");
 }
示例#2
0
 /** Test of setQuery method, of class Question. */
 @Test
 public void testSetQuery() {
   System.out.println("setQuery");
   String inQuery = "";
   Question instance = new Question();
   instance.setQuery(inQuery);
   // TODO review the generated test code and remove the default call to fail.
   fail("The test case is a prototype.");
 }
示例#3
0
 @Test
 public void test_question_setType() {
   // GIVEN
   Question q = new Question();
   QuestionType qt = QuestionType.SIMPLE_CHOICE;
   // WHEN
   q.setType(qt);
   // THEN
   assertEquals(q.getType(), qt);
 }
示例#4
0
 @Test
 public void test_question_setAllowNoAnswer_true() {
   // GIVEN
   Question q = new Question();
   boolean allow = true;
   // WHEN
   q.setAllowNoAnswer(allow);
   // THEN
   assertEquals(q.isAllowNoAnswer(), allow);
 }
示例#5
0
 @Test
 public void test_question_setId() {
   // GIVEN
   Question q = new Question();
   long id = 512;
   // WHEN
   q.setId(id);
   // THEN
   assertEquals(q.getId(), id);
 }
示例#6
0
 @Test
 public void test_question_setPoll() {
   // GIVEN
   Question q = new Question();
   Poll p = new Poll();
   // WHEN
   q.setPoll(p);
   // THEN
   assertEquals(q.getPoll(), p);
 }
示例#7
0
 @Test
 public void test_question_setAllowAddAnswer_false() {
   // GIVEN
   Question q = new Question();
   boolean b = false;
   // WHEN
   q.setAllowAddAnswer(b);
   // THEN
   assertEquals(q.isAllowAddAnswer(), b);
 }
示例#8
0
 @Test
 public void test_question_setMedia() {
   // GIVEN
   Question q = new Question();
   Media m = new Media();
   // WHEN
   q.setMedia(m);
   // THEN
   assertEquals(q.getMedia(), m);
 }
示例#9
0
 @Test
 public void test_question_setText() {
   // GIVEN
   Question q = new Question();
   String text = "Blabla";
   // WHEN
   q.setText(text);
   // THEN
   assertEquals(q.getText(), text);
 }
示例#10
0
 @Test
 public void test_question_setConditions() {
   // GIVEN
   Question q = new Question();
   List<QuestionCondition> lcond = new ArrayList<QuestionCondition>();
   // WHEN
   q.setConditions(lcond);
   // THEN
   assertEquals(q.getConditions(), lcond);
 }
示例#11
0
 @Test
 public void test_question_setProposedChoices() {
   // GIVEN
   Question q = new Question();
   List<ProposedChoice> lprop = new ArrayList<ProposedChoice>();
   // WHEN
   q.setProposedChoices(lprop);
   // THEN
   assertEquals(q.getProposedChoices(), lprop);
 }
示例#12
0
 @Test
 public void test_question_setAnswers() {
   // GIVEN
   Question q = new Question();
   List<Answer> lAns = new ArrayList<Answer>();
   // WHEN
   q.setAnswers(lAns);
   // THEN
   assertEquals(q.getAnswers(), lAns);
 }
示例#13
0
 /** Test of getDateCreated method, of class Question. */
 @Test
 public void testGetDateCreated() {
   System.out.println("getDateCreated");
   Question instance = new Question();
   ObjectProperty<LocalDate> expResult = null;
   ObjectProperty<LocalDate> result = instance.getDateCreated();
   assertEquals(expResult, result);
   // TODO review the generated test code and remove the default call to fail.
   fail("The test case is a prototype.");
 }
示例#14
0
 @Test
 public void test_question_setOrderNumber() {
   // GIVEN
   Question q = new Question();
   int order = 54;
   // WHEN
   q.setOrderNumber(order);
   // THEN
   assertEquals(q.getOrderNumber(), order);
 }
示例#15
0
 /** Test of queryProperty method, of class Question. */
 @Test
 public void testQueryProperty() {
   System.out.println("queryProperty");
   Question instance = new Question();
   SimpleStringProperty expResult = null;
   SimpleStringProperty result = instance.queryProperty();
   assertEquals(expResult, result);
   // TODO review the generated test code and remove the default call to fail.
   fail("The test case is a prototype.");
 }
示例#16
0
 /** Test of getQuery method, of class Question. */
 @Test
 public void testGetQuery() {
   System.out.println("getQuery");
   Question instance = new Question();
   String expResult = "";
   String result = instance.getQuery();
   assertEquals(expResult, result);
   // TODO review the generated test code and remove the default call to fail.
   fail("The test case is a prototype.");
 }
示例#17
0
 @Test
 public void test_question_setId_0() {
   // GIVEN
   Question q = new Question();
   long id = 0;
   try {
     // WHEN
     q.setId(id);
     fail("Id can not be negative or 0");
   } catch (IllegalArgumentException exc) {
     // THEN
     assertEquals(exc.getMessage(), "Id can not be negative or 0");
   }
 }
示例#18
0
 @Test
 public void test_question_questionMultiChoice() {
   // GIVEN
   Poll sond = new Poll();
   Question q = new Question();
   q.setType(QuestionType.MULTIPLE_CHOICE);
   List<Question> lq = new ArrayList<Question>();
   lq.add(q);
   // WHEN
   sond.setQuestions(lq);
   // THEN
   assertNotNull(sond.getQuestions());
   assertNotNull(sond.getQuestions().get(0));
   assertEquals(sond.getQuestions().get(0).getType(), QuestionType.MULTIPLE_CHOICE);
 }
示例#19
0
  @Test
  public void test_question_setOrderNumber_negative() {
    // GIVEN
    Question q = new Question();
    int order = -54;

    try {
      // WHEN
      q.setOrderNumber(order);
      fail("order number can not be negative or 0");
    } catch (IllegalArgumentException exc) {
      // THEN
      assertEquals(exc.getMessage(), "order number can not be negative or 0");
    }
  }