@@ -0,0 +1,2204 @@
+package com.connectsdk.device;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport junit.framework.Assert;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.Mockito;%0A%0Aimport com.connectsdk.service.DeviceService;%0Aimport com.connectsdk.service.capability.Launcher;%0Aimport com.connectsdk.service.capability.MediaPlayer;%0A%0Apublic class ConnectableDeviceTest %7B%0A%0A%09private ConnectableDevice device;%0A%0A%09@Before%0A%09public void setUp() %7B%0A%09%09device = new ConnectableDevice();%0A%09%7D%0A%09%0A%09@Test%0A%09public void testHasCapabilityWithEmptyServices() %7B%0A%09%09Assert.assertFalse(device.hasCapability(MediaPlayer.Display_Video));%0A%09%7D%0A%09%0A%09@Test%0A%09public void testHasCapabilityWithServices() %7B%0A%09%09DeviceService service = Mockito.mock(DeviceService.class);%0A%09%09Mockito.when(service.hasCapability(MediaPlayer.Display_Video)).thenReturn(Boolean.TRUE);%0A%09%09device.services.put(%22service%22, service);%0A%09%09Assert.assertTrue(device.hasCapability(MediaPlayer.Display_Video));%0A%09%7D%0A%09%0A%09@Test%0A%09public void testHasAnyCapabilities() %7B%0A%09%09DeviceService service = Mockito.mock(DeviceService.class);%0A%09%09String%5B%5D capabilities = %7BLauncher.Browser, Launcher.YouTube%7D;%0A%09%09Mockito.when(service.hasAnyCapability(capabilities)).thenReturn(Boolean.TRUE);%0A%09%09device.services.put(%22service%22, service);%0A%09%09Assert.assertTrue(device.hasAnyCapability(capabilities));%0A%09%7D%0A%09%0A%09@Test%0A%09public void testHasAnyCapabilitiesWithoutServices() %7B%0A%09%09DeviceService service = Mockito.mock(DeviceService.class);%0A%09%09String%5B%5D capabilities = %7BLauncher.Browser, Launcher.YouTube%7D;%0A%09%09Mockito.when(service.hasAnyCapability(capabilities)).thenReturn(Boolean.FALSE);%0A%09%09device.services.put(%22service%22, service);%0A%09%09Assert.assertFalse(device.hasAnyCapability(capabilities));%0A%09%7D%0A%09%0A%09@Test%0A%09public void testHasCapabilities() %7B%0A%09%09DeviceService service = Mockito.mock(DeviceService.class);%0A%09%09Mockito.when(service.hasCapability(Launcher.Browser)).thenReturn(Boolean.TRUE);%0A%09%09Mockito.when(service.hasCapability(Launcher.YouTube)).thenReturn(Boolean.TRUE);%0A%09%09device.services.put(%22service%22, service);%0A%09%09%0A%09%09List%3CString%3E capabilities = new ArrayList%3CString%3E();%0A%09%09capabilities.add(Launcher.Browser);%0A%09%09capabilities.add(Launcher.YouTube);%0A%09%09%0A%09%09Assert.assertTrue(device.hasCapabilities(capabilities));%0A%09%7D%0A%09%0A%7D%0A

Add test for hasCapability* methods of ConnectableDevice