package com.farmerbb.taskbar.service;

import com.farmerbb.taskbar.ui.DashboardController;
import com.farmerbb.taskbar.ui.StartMenuController;
import com.farmerbb.taskbar.ui.TaskbarController;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.android.controller.ServiceController;

import static org.junit.Assert.assertTrue;

@RunWith(RobolectricTestRunner.class)
public class UIHostServiceNewControllerTest {
    @Test
    public void testDashboardService() {
        ServiceController<DashboardService> dashboardService =
                Robolectric.buildService(DashboardService.class);
        assertTrue(dashboardService.get().newController() instanceof DashboardController);
    }

    @Test
    public void testStartMenuService() {
        ServiceController<StartMenuService> startMenuService =
                Robolectric.buildService(StartMenuService.class);
        assertTrue(startMenuService.get().newController() instanceof StartMenuController);
    }

    @Test
    public void testTaskbarService() {
        ServiceController<TaskbarService> taskbarService =
                Robolectric.buildService(TaskbarService.class);
        assertTrue(taskbarService.get().newController() instanceof TaskbarController);
    }
}

@@ -328,69 +328,8 @@
 ner;
-%0Aimport org.robolectric.android.controller.ServiceController;
 %0A%0Aim
@@ -513,34 +513,16 @@
         
-ServiceController%3C
 Dashboar
@@ -529,17 +529,16 @@
 dService
-%3E
  dashboa
@@ -548,32 +548,16 @@
 ervice =
-%0A               
  Robolec
@@ -553,37 +553,37 @@
 e = Robolectric.
-build
+setup
 Service(Dashboar
@@ -627,38 +627,32 @@
 ashboardService.
-get().
 newController() 
@@ -750,34 +750,16 @@
         
-ServiceController%3C
 StartMen
@@ -766,17 +766,16 @@
 uService
-%3E
  startMe
@@ -785,32 +785,16 @@
 ervice =
-%0A               
  Robolec
@@ -790,37 +790,37 @@
 e = Robolectric.
-build
+setup
 Service(StartMen
@@ -864,38 +864,32 @@
 tartMenuService.
-get().
 newController() 
@@ -989,26 +989,8 @@
     
-ServiceController%3C
 Task
@@ -1003,9 +1003,8 @@
 vice
-%3E
  tas
@@ -1020,24 +1020,8 @@
 ce =
-%0A               
  Rob
@@ -1033,13 +1033,13 @@
 ric.
-build
+setup
 Serv
@@ -1103,14 +1103,8 @@
 ice.
-get().
 newC

Simplify UIHostServiceNewControllerTest