use of android.net.wifi.p2p.WifiP2pGroupList in project android_packages_apps_Settings by omnirom.
the class WifiP2pSettingsTest method persistentController_withOneGroup_shouldBeAvailable.
@Test
public void persistentController_withOneGroup_shouldBeAvailable() {
final String fakeGroupName = new String("fakeGroupName");
doReturn(fakeGroupName).when(mWifiP2pGroup).getNetworkName();
final List<WifiP2pGroup> groupList = new ArrayList<>();
groupList.add(mWifiP2pGroup);
final WifiP2pGroupList wifiP2pGroupList = mock(WifiP2pGroupList.class);
doReturn(groupList).when(wifiP2pGroupList).getGroupList();
final Bundle bundle = new Bundle();
bundle.putString(WifiP2pSettings.SAVE_SELECTED_GROUP, fakeGroupName);
mFragment.onActivityCreated(bundle);
mFragment.onPersistentGroupInfoAvailable(wifiP2pGroupList);
assertThat(mFragment.mPersistentCategoryController.isAvailable()).isTrue();
}
use of android.net.wifi.p2p.WifiP2pGroupList in project android_packages_apps_Settings by omnirom.
the class WifiP2pSettingsTest method persistentController_withNoGroup_shouldBeUnavailable.
@Test
public void persistentController_withNoGroup_shouldBeUnavailable() {
final WifiP2pGroupList wifiP2pGroupList = mock(WifiP2pGroupList.class);
final List<WifiP2pGroup> groupList = new ArrayList<>();
doReturn(groupList).when(wifiP2pGroupList).getGroupList();
mFragment.onPersistentGroupInfoAvailable(wifiP2pGroupList);
assertThat(mFragment.mPersistentCategoryController.isAvailable()).isFalse();
}
Aggregations