Abgabe Übungstest 5

This commit is contained in:
2022-05-19 14:38:54 +02:00
parent 088fa3cdeb
commit 05c52cd3f5
2 changed files with 37 additions and 2 deletions

View File

@ -78,4 +78,19 @@ public class Aufgabe5Test {
assertEquals(hashCode2, map.hashCode());
assertNotEquals(hashCode1, hashCode2);
}
@Test
public void testDelKey() {
MassiveForceHashMap map = new MassiveForceHashMap();
NamedBody sun1 = new NamedBody(SolSystem4.SUN_NAMED);
NamedBody earth1 = new NamedBody(SolSystem4.EARTH_NAMED);
NamedBody moon1 = new NamedBody(SolSystem4.MOON_NAMED);
map.put(sun1, new Vector3());
map.put(earth1, new Vector3());
map.put(moon1, new Vector3());
assertNotNull(map.get(sun1));
assertNotNull(map.delete(sun1));
assertNull(map.get(sun1));
assertNull(map.delete(sun1));
}
}