2
0
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:
Erik Duisters 2019-03-03 16:55:59 +01:00
parent b135ffa92a
commit bc2836f45f

View File

@ -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();
} }
} }