@Before public void setUp() { tray = mock(Tray.class); resources = mock(Resources.class); trayIcons = new TrayIcons(); trayIcons.setTray(tray); trayIcons.setResources(resources); Dimension trayIconSize = new Dimension(TRAY_ICON_SIZE, TRAY_ICON_SIZE); when(tray.iconSize()).thenReturn(trayIconSize); }
@Test public void testDefaultTomatoIcon() { Image defaultIcon = mock(Image.class); when(resources.image(resourceName(TrayIcons.DEFAULT_ICON_SIZE))).thenReturn(defaultIcon); Image icon = trayIcons.tomato(); assertThat(icon, equalTo(defaultIcon)); }
@Test public void testTomato() { Image expectedIcon = mock(Image.class); when(resources.image(resourceName(TRAY_ICON_SIZE))).thenReturn(expectedIcon); Image icon = trayIcons.tomato(); assertThat(icon, equalTo(expectedIcon)); }