Last change
on this file since 9339 was 9231, checked in by Don-vip, 8 years ago |
javadoc update
|
-
Property svn:eol-style
set to
native
|
File size:
1.2 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.util;
|
---|
3 |
|
---|
4 | import static org.junit.Assert.assertEquals;
|
---|
5 |
|
---|
6 | import org.junit.Test;
|
---|
7 |
|
---|
8 | /**
|
---|
9 | * Unit tests of {@link RotationAngle} class.
|
---|
10 | */
|
---|
11 | public class RotationAngleTest {
|
---|
12 |
|
---|
13 | private static final double EPSILON = 1e-11;
|
---|
14 |
|
---|
15 | /**
|
---|
16 | * Unit test of method {@link RotationAngle#buildStaticRotation} - nominal cases.
|
---|
17 | */
|
---|
18 | @Test
|
---|
19 | public void testParseCardinal() {
|
---|
20 | assertEquals(Math.PI, RotationAngle.buildStaticRotation("south").getRotationAngle(null), EPSILON);
|
---|
21 | assertEquals(Math.PI, RotationAngle.buildStaticRotation("s").getRotationAngle(null), EPSILON);
|
---|
22 | assertEquals(Math.toRadians(315), RotationAngle.buildStaticRotation("northwest").getRotationAngle(null), EPSILON);
|
---|
23 | }
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * Unit test of method {@link RotationAngle#buildStaticRotation} - wrong parameter.
|
---|
27 | */
|
---|
28 | @Test(expected = IllegalArgumentException.class)
|
---|
29 | public void testParseFail() {
|
---|
30 | RotationAngle.buildStaticRotation("bad");
|
---|
31 | }
|
---|
32 |
|
---|
33 | /**
|
---|
34 | * Unit test of method {@link RotationAngle#buildStaticRotation} - null handling.
|
---|
35 | */
|
---|
36 | @Test(expected = NullPointerException.class)
|
---|
37 | public void testParseNull() {
|
---|
38 | RotationAngle.buildStaticRotation(null);
|
---|
39 | }
|
---|
40 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.