/** Test of getId method, of class JsonpWorld. */ @Test public void testGetId() throws Exception { System.out.println("getId"); final Field idField = instance.getClass().getDeclaredField("id"); // NOI18N. idField.setAccessible(true); final int expResult = idField.getInt(instance); final int result = instance.getId(); assertEquals(expResult, result); }
/** Test of getName method, of class JsonpWorld. */ @Test public void testGetName() throws Exception { System.out.println("getName"); final Field nameFdield = instance.getClass().getDeclaredField("name"); // NOI18N. nameFdield.setAccessible(true); final String expResult = (String) nameFdield.get(instance); final String result = instance.getName(); assertNotNull(result); assertEquals(expResult, result); }
@Before public void setUp() throws Exception { instance = new JsonpWorld(); final Field idField = instance.getClass().getDeclaredField("id"); // NOI18N. idField.setAccessible(true); idField.setInt(instance, 1); // NOI18N. final Field nameField = instance.getClass().getDeclaredField("name"); // NOI18N. nameField.setAccessible(true); nameField.set(instance, "Test World"); // NOI18N. }