@Test public void testRegisterUnregister() { assertEquals(0, registry.size()); // register registry.register("foo", object); assertEquals(1, registry.size()); assertEquals(object, registry.getObjectByName("foo")); assertTrue(registry.isRegistered(object)); assertTrue(registry.isRegistered("foo")); registry.unregister("foo"); assertEquals(0, registry.size()); }
@Test public void testRegistrationBehaviors() { assertEquals(0, registry.size()); // register registry.register("foo", object); assertEquals(1, registry.size()); assertTrue(registry.isRegistered(object)); assertTrue(registry.isRegistered("foo")); // register again registry.register("foo", object); assertEquals(1, registry.size()); }
@Test public void testRegistry() { assertEquals("My Registry", registry.getName()); }
@After public void tearDown() { registry.clear(); }