1 /* Copyright (c) 2000-2003, jMock.org. See bundled LICENSE.txt */ 2 package org.jmock.expectation; 3 4 import java.util.Vector; 5 6 public class TestExpectationSet extends AbstractTestExpectationCollection { 7 8 protected void setUp() throws Exception { 9 super.setUp(); 10 myExpectation = new ExpectationSet(getClass().getName()); 11 } 12 13 // look at super-class for more tests. 14 15 public void testMultiUnsorted() { 16 myExpectation.addExpectedMany(new String[]{"A", "B"}); 17 18 myExpectation.addActualMany(new String[]{"A", "B"}); 19 20 myExpectation.verify(); 21 } 22 23 public void testChangingHashcode() { 24 final Vector value = new Vector(); 25 26 myExpectation.addExpected(new MapEntry("key", value)); 27 myExpectation.addActual(new MapEntry("key", value)); 28 29 value.add(getName()); 30 31 myExpectation.verify(); 32 } 33 34 public void testChanginHashcodeImediateCheck() { 35 final Vector value = new Vector(); 36 37 myExpectation.addExpected(new MapEntry("key", value)); 38 value.add(getName()); 39 myExpectation.addActual(new MapEntry("key", value)); 40 41 myExpectation.verify(); 42 } 43 44 public void testMultiUnsortedSet() { 45 myExpectation.addExpectedMany(new String[]{"A", "B"}); 46 47 myExpectation.addActualMany(new String[]{"A", "B", "A", "B"}); 48 49 myExpectation.verify(); 50 } 51 52 public void testUnsorted() { 53 myExpectation.addExpected("A"); 54 myExpectation.addExpected("B"); 55 56 myExpectation.addActual("B"); 57 myExpectation.addActual("A"); 58 59 myExpectation.verify(); 60 } 61 62 public void testUnsortedSet() { 63 myExpectation.addExpected("A"); 64 myExpectation.addExpected("B"); 65 66 myExpectation.addActual("A"); 67 myExpectation.addActual("B"); 68 myExpectation.addActual("A"); 69 myExpectation.addActual("B"); 70 71 myExpectation.verify(); 72 } 73 }

This page was automatically generated by Maven