Code example for LocationManager

Methods: getBestProvider

0
  } 
 
  @Test 
  public void shouldStoreBestProviderCriteriaAndEnabledOnlyFlag() throws Exception { 
    Criteria criteria = new Criteria();
    assertNull(locationManager.getBestProvider(criteria, true));
    assertSame(criteria, shadowLocationManager.getLastBestProviderCriteria());
    assertTrue(shadowLocationManager.getLastBestProviderEnabledOnly());
  } 
 
  @Test 
  public void shouldReturnNullIfBestProviderNotExplicitlySet() throws Exception { 
    Criteria criteria = new Criteria();
    assertNull(locationManager.getBestProvider(null, false));
    assertNull(locationManager.getBestProvider(null, true));
    assertNull(locationManager.getBestProvider(criteria, false));
    assertNull(locationManager.getBestProvider(criteria, true));
  } 
 
  @Test 
  public void shouldThrowExceptionWhenRequestingLocationUpdatesWithANullIntent() throws Exception {