source: josm/trunk/test/unit/org/openstreetmap/josm/tools/ShortcutTest.java@ 15702

Last change on this file since 15702 was 14689, checked in by simon04, 5 years ago

fix #17202 - InputMapUtils: display Ctrl+Enter in action tooltip

File size: 874 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.tools;
3
4import static org.junit.Assert.assertEquals;
5
6import java.awt.event.InputEvent;
7import java.awt.event.KeyEvent;
8
9import javax.swing.KeyStroke;
10
11import org.junit.BeforeClass;
12import org.junit.Test;
13import org.openstreetmap.josm.JOSMFixture;
14
15/**
16 * Unit tests of {@link Shortcut} class.
17 */
18public class ShortcutTest {
19
20 /**
21 * Setup test.
22 */
23 @BeforeClass
24 public static void setUp() {
25 JOSMFixture.createUnitTestFixture().init();
26 }
27
28 /**
29 * Test method for {@code Shortcut#makeTooltip}
30 */
31 @Test
32 public void testMakeTooltip() {
33 assertEquals("<html>Foo Bar <font size='-2'>(Shift+J)</font>&nbsp;</html>",
34 Shortcut.makeTooltip("Foo Bar", KeyStroke.getKeyStroke(KeyEvent.VK_J, InputEvent.SHIFT_DOWN_MASK)));
35 }
36
37}
Note: See TracBrowser for help on using the repository browser.