Code example for WifiManager

Methods: setWifiEnabled

0
  } 
 
  @Test(expected = SecurityException.class) 
  public void setWifiEnabled_shouldThrowSecurityExceptionWhenAccessWifiStatePermissionNotGranted() throws Exception { 
    shadowWifiManager.setAccessWifiStatePermission(false);
    wifiManager.setWifiEnabled(true);
  } 
 
  @Test(expected = SecurityException.class) 
  public void isWifiEnabled_shouldThrowSecurityExceptionWhenAccessWifiStatePermissionNotGranted() throws Exception { 
    shadowWifiManager.setAccessWifiStatePermission(false);
    wifiManager.isWifiEnabled();
  } 
 
  @Test(expected = SecurityException.class) 
  public void getConnectionInfo_shouldThrowSecurityExceptionWhenAccessWifiStatePermissionNotGranted() throws Exception { 
    shadowWifiManager.setAccessWifiStatePermission(false);
    wifiManager.getConnectionInfo();
  }