MapSelectionActivity extends AbstractMapSelectionActivity { @Override public Intent getIntentWithMapName(final String mapName) { final Intent intent = new Intent(this, MapActivity.class); intent.putExtra("MapName", mapName); return intent; }  @Override Intent getIntentWithMapName(final String mapName);  }
@Test public void testThatGetIntentWithMapNameReturnsIntentWithMapNameAsExtraParameter() { final MapSelectionActivity msa = new MapSelectionActivity(); Intent intent1 = msa.getIntentWithMapName("test1"); Intent intent2 = msa.getIntentWithMapName("test2"); assertTrue(intent1.getStringExtra("MapName").equals("test1")); assertTrue(intent2.getStringExtra("MapName").equals("test2")); }
@Test public void testGetIntentWithMapNameHoldsMapNameAsExtraString() { final String testMapName = "testMapName"; Intent intent = activity.getIntentWithMapName(testMapName); assertEquals(intent.getStringExtra("MapName"), testMapName); }