mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 09:58:08 +00:00
Also verify that Device.PairingCallback.unpaired() is called
This commit is contained in:
parent
b135ffa92a
commit
bc2836f45f
@ -273,7 +273,9 @@ public class DeviceTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testUnpair() {
|
public void testUnpair() {
|
||||||
|
Device.PairingCallback pairingCallback = Mockito.mock(Device.PairingCallback.class);
|
||||||
Device device = new Device(context, "testDevice");
|
Device device = new Device(context, "testDevice");
|
||||||
|
device.addPairingCallback(pairingCallback);
|
||||||
|
|
||||||
device.unpair();
|
device.unpair();
|
||||||
|
|
||||||
@ -281,5 +283,7 @@ public class DeviceTest {
|
|||||||
|
|
||||||
SharedPreferences preferences = context.getSharedPreferences("trusted_devices", Context.MODE_PRIVATE);
|
SharedPreferences preferences = context.getSharedPreferences("trusted_devices", Context.MODE_PRIVATE);
|
||||||
assertFalse(preferences.getBoolean(device.getDeviceId(), false));
|
assertFalse(preferences.getBoolean(device.getDeviceId(), false));
|
||||||
|
|
||||||
|
Mockito.verify(pairingCallback, Mockito.times(1)).unpaired();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user