From 024a084b9a67beb81e60bd5d10d2cef4b1d708eb Mon Sep 17 00:00:00 2001 From: Erik Duisters Date: Sat, 2 Mar 2019 17:42:46 +0100 Subject: [PATCH] Add DeviceType test --- tests/org/kde/kdeconnect/DeviceTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/org/kde/kdeconnect/DeviceTest.java b/tests/org/kde/kdeconnect/DeviceTest.java index 2606e483..c69d114f 100644 --- a/tests/org/kde/kdeconnect/DeviceTest.java +++ b/tests/org/kde/kdeconnect/DeviceTest.java @@ -114,6 +114,16 @@ public class DeviceTest { Mockito.when(context.getSystemService(eq(Context.NOTIFICATION_SERVICE))).thenReturn(Mockito.mock(NotificationManager.class)); } + @Test + public void testDeviceType() { + assertEquals(Device.DeviceType.Phone, Device.DeviceType.FromString(Device.DeviceType.Phone.toString())); + assertEquals(Device.DeviceType.Tablet, Device.DeviceType.FromString(Device.DeviceType.Tablet.toString())); + assertEquals(Device.DeviceType.Computer, Device.DeviceType.FromString(Device.DeviceType.Computer.toString())); + assertEquals(Device.DeviceType.Tv, Device.DeviceType.FromString(Device.DeviceType.Tv.toString())); + assertEquals(Device.DeviceType.Computer, Device.DeviceType.FromString("")); + assertEquals(Device.DeviceType.Computer, Device.DeviceType.FromString(null)); + } + // Basic paired device testing @Test public void testDevice() {