source: trunk/tests/org/expeditee/gui/FreeItemsTest.java@ 1102

Last change on this file since 1102 was 1102, checked in by davidb, 6 years ago

Reworking of the code-base to separate logic from graphics. This version of Expeditee now supports a JFX graphics as an alternative to SWING

File size: 1.2 KB
Line 
1package org.expeditee.gui;
2
3
4public class FreeItemsTest extends GuiTestCase {
5
6 /**
7 * Test the picking up and putting down of objects on a frame.
8 *
9 * @throws Exception
10 */
11 public final void testAttachedToCursor() throws Exception {
12 Frame testFrame = showFrame("ExpediteeTest2");
13
14 FrameMouseActions.pickup(testFrame.getTitleItem());
15 assertTrue(FreeItems.hasItemsAttachedToCursor());
16 assertTrue(FreeItems.textOnlyAttachedToCursor());
17
18 FrameMouseActions.anchor(FreeItems.getInstance());
19 assertFalse(FreeItems.hasItemsAttachedToCursor());
20 assertFalse(FreeItems.textOnlyAttachedToCursor());
21
22 FrameMouseActions.pickup(testFrame.getAllItems());
23 assertTrue(FreeItems.hasItemsAttachedToCursor());
24 assertFalse(FreeItems.textOnlyAttachedToCursor());
25 assertEquals(8, FreeItems.getTextItems().size());
26
27 assertEquals(1, FreeItems.getGroupedText().get("").size());
28 assertEquals(2, FreeItems.getGroupedText().get("Label").size());
29 assertEquals(3, FreeItems.getGroupedText().get("Label2").size());
30 assertEquals(null, FreeItems.getGroupedText().get("non existing label"));
31
32 FrameMouseActions.anchor(FreeItems.getInstance());
33 assertFalse(FreeItems.hasItemsAttachedToCursor());
34 assertFalse(FreeItems.textOnlyAttachedToCursor());
35 }
36}
Note: See TracBrowser for help on using the repository browser.