Example #1
0
 @Test
 public void test_question_setOrderNumber() {
   // GIVEN
   Question q = new Question();
   int order = 54;
   // WHEN
   q.setOrderNumber(order);
   // THEN
   assertEquals(q.getOrderNumber(), order);
 }
Example #2
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");
    }
  }