public void testBogusPostPush1() { Stack<Integer> countingStack = new BogusCountingStack<Integer>(); try { countingStack.push(1); fail(); } catch (PostconditionError expected) { assertEquals("[peek() == old (obj)]", expected.getMessages().toString()); } }
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()); } }