use of com.android.wifitrackerlib.WifiPickerTracker in project android_packages_apps_Settings by omnirom.
the class NetworkRequestDialogFragmentTest method onMatchManyResult_showNeutralButton.
@Test
public void onMatchManyResult_showNeutralButton() {
networkRequestDialogFragment.show(mActivity.getSupportFragmentManager(), /* tag */
null);
final AlertDialog alertDialog = ShadowAlertDialogCompat.getLatestAlertDialog();
List<WifiEntry> wifiEntryList = createWifiEntryList();
final WifiPickerTracker wifiPickerTracker = mock(WifiPickerTracker.class);
when(wifiPickerTracker.getWifiEntries()).thenReturn(wifiEntryList);
networkRequestDialogFragment.mWifiPickerTracker = wifiPickerTracker;
final String ssidAp = "Test AP ";
final List<ScanResult> scanResults = new ArrayList<>();
for (int i = 0; i < 7; i++) {
ScanResult scanResult = mock(ScanResult.class);
scanResult.SSID = ssidAp + i;
scanResult.capabilities = "WEP";
scanResults.add(scanResult);
}
networkRequestDialogFragment.onMatch(scanResults);
final Button button = alertDialog.getButton(AlertDialog.BUTTON_NEUTRAL);
assertThat(button).isNotNull();
assertThat(button.getVisibility()).isEqualTo(View.VISIBLE);
}
Aggregations