Ignore:
Timestamp:
2015-10-11T17:28:19+02:00 (6 years ago)
Author:
Don-vip
Message:

improve/cleanup unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/util/RotationAngleTest.java

    r8624 r8857  
    22package org.openstreetmap.josm.gui.util;
    33
    4 import static org.hamcrest.CoreMatchers.is;
    5 import static org.junit.Assert.assertThat;
     4import static org.junit.Assert.assertEquals;
    65
    76import org.junit.Test;
    87
     8/**
     9 * Unit tests of {@link RotationAngle} class.
     10 */
    911public class RotationAngleTest {
    1012
     13    private static final double EPSILON = 1e-11;
     14
    1115    @Test
    12     public void testParseCardinal() throws Exception {
    13         assertThat(RotationAngle.buildStaticRotation("south").getRotationAngle(null), is(Math.PI));
    14         assertThat(RotationAngle.buildStaticRotation("s").getRotationAngle(null), is(Math.PI));
    15         assertThat(RotationAngle.buildStaticRotation("northwest").getRotationAngle(null), is(Math.toRadians(315)));
     16    public void testParseCardinal() {
     17        assertEquals(Math.PI, RotationAngle.buildStaticRotation("south").getRotationAngle(null), EPSILON);
     18        assertEquals(Math.PI, RotationAngle.buildStaticRotation("s").getRotationAngle(null), EPSILON);
     19        assertEquals(Math.toRadians(315), RotationAngle.buildStaticRotation("northwest").getRotationAngle(null), EPSILON);
    1620    }
    1721
    1822    @Test(expected = IllegalArgumentException.class)
    19     public void testParseFail() throws Exception {
     23    public void testParseFail() {
    2024        RotationAngle.buildStaticRotation("bad");
    2125    }
    2226
    2327    @Test(expected = NullPointerException.class)
    24     public void testParseNull() throws Exception {
     28    public void testParseNull() {
    2529        RotationAngle.buildStaticRotation(null);
    2630    }
Note: See TracChangeset for help on using the changeset viewer.