source: josm/trunk/test/unit/org/openstreetmap/josm/gui/bbox/SizeButtonTest.java@ 18037

Last change on this file since 18037 was 18037, checked in by Don-vip, 3 years ago

fix #21064 - Add JUnit 5 extension for preferences (patch by taylor.smock)

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.bbox;
3
4import static org.junit.jupiter.api.Assertions.assertEquals;
5import static org.junit.jupiter.api.Assertions.assertFalse;
6import static org.junit.jupiter.api.Assertions.assertTrue;
7
8import org.openstreetmap.josm.TestUtils;
9import org.openstreetmap.josm.gui.bbox.SizeButton.AccessibleSizeButton;
10import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
11
12import org.junit.jupiter.api.Test;
13
14/**
15 * Unit tests of {@link SizeButton} class.
16 */
17@BasicPreferences
18class SizeButtonTest {
19 /**
20 * Unit test of {@link SizeButton#SizeButton}.
21 */
22 @Test
23 void testSizeButton() {
24 SizeButton sb = new SizeButton(new SlippyMapBBoxChooser());
25 sb.paint(TestUtils.newGraphics());
26 AccessibleSizeButton asb = (AccessibleSizeButton) sb.getAccessibleContext();
27 assertEquals(1, asb.getAccessibleActionCount());
28 assertEquals("toggle", asb.getAccessibleActionDescription(0));
29 assertFalse(sb.isEnlarged());
30 assertTrue(asb.doAccessibleAction(0));
31 sb.paint(TestUtils.newGraphics());
32 assertTrue(sb.isEnlarged());
33 }
34}
Note: See TracBrowser for help on using the repository browser.