Exemple #1
0
 @Before
 public void setUp() {
   map = new GoITMap();
   map.put(new Integer(1), "one");
   map.put(new Integer(11), "one");
   System.out.println("setup");
 }
Exemple #2
0
 public static void main(String[] args) {
   GoITMap map = new GoITMap();
   map.put(new Integer(1), "One");
   map.put(new Integer(1), "One");
   map.put(new Integer(2), "Two");
   map.put(new Integer(11), "Eleven");
   System.out.println("assumed value: " + map.get(new Integer(1)));
   System.out.println(map.get(new Integer(2)));
   System.out.println(map.get(new Integer(1)));
   System.out.println(map.get(new Integer(11)));
   System.out.println(map.size());
 }
Exemple #3
0
 @Test
 public void testSize() {
   assertEquals("checking size of map", 2, map.size());
 }
Exemple #4
0
 @Test(expected = NoSuchElementException.class)
 public void testRemove() {
   map.remove("somekey");
 }
Exemple #5
0
 @Test
 public void testReturnValue() {
   assertEquals("return value checking", "one", map.get(1));
 }