108109110111112113114115116117118
assertEquals(0, d.getItemCount()); d.addValue("A", 1.0); assertEquals(1, d.getItemCount()); d.addValue("B", 2.0); assertEquals(2, d.getItemCount()); d.clear(); assertEquals(0, d.getItemCount()); } /** * Some checks for the getKeys() method.
128129130131132133134135136137138
d.addValue("B", 2.0); keys = d.getKeys(); assertEquals(2, keys.size()); assertTrue(keys.contains("A")); assertTrue(keys.contains("B")); d.clear(); keys = d.getKeys(); assertEquals(0, keys.size()); } /**
141142143144145146147148149150151
public void testClear() { DefaultKeyedValues v1 = new DefaultKeyedValues(); v1.addValue("A", 1.0); v1.addValue("B", 2.0); assertEquals(2, v1.getItemCount()); v1.clear(); assertEquals(0, v1.getItemCount()); } /** * Some checks for the getValue() methods.