Esempio n. 1
0
 public void testBogusPostPush1() {
   Stack<Integer> countingStack = new BogusCountingStack<Integer>();
   try {
     countingStack.push(1);
     fail();
   } catch (PostconditionError expected) {
     assertEquals("[peek() == old (obj)]", expected.getMessages().toString());
   }
 }
Esempio n. 2
0
 public void testBogusPostPush() {
   Stack<Integer> bogusPostconditionsStack = new BogusPostconditionsStack<Integer>();
   try {
     bogusPostconditionsStack.push(1);
     fail();
   } catch (PostconditionError expected) {
     assertEquals("[size() == old (size()) + 1]", expected.getMessages().toString());
   }
 }