Пример #1
0
 @Test
 public void testEnsureNotNegative_ValidCase() {
   IllegalStateException unexpected = null;
   try {
     DBQueries.ensureNotNegative(0);
     DBQueries.ensureNotNegative(1);
   } catch (IllegalStateException e) {
     unexpected = e;
   }
   assertNull(unexpected);
 }
Пример #2
0
 @Test
 public void testEnsureNotNegative_InvalidCase() {
   IllegalStateException expected = null;
   try {
     DBQueries.ensureNotNegative(-1);
   } catch (IllegalStateException e) {
     expected = e;
   }
   assertNotNull(expected);
   assertEquals("Update returned error code: -1", expected.getMessage());
 }