Exemplo n.º 1
0
 @Test(expected = NumberFormatException.class)
 public void test_keyWithTooBigIntegerValue_shouldFail() {
   Key key = Key.create(KEY_6_NAME, Key.KEY_VALUE, KEY_6_VALUE, Key.KEY_END);
   // assert only to trigger key.getInteger() function which throws exception
   assertEquals(false, Long.parseLong(KEY_6_VALUE) == key.getInteger().intValue());
 }
Exemplo n.º 2
0
 @Test
 public void test_keyWithIntegerValue_shouldPass() {
   Key key = Key.create(KEY_5_NAME, Key.KEY_VALUE, KEY_5_VALUE, Key.KEY_END);
   assertEquals(true, Integer.parseInt(KEY_5_VALUE) == key.getInteger().intValue());
 }