package org.jfree.chart.axis.junit;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

import org.jfree.chart.axis.CompassFormat;

/**
 * Tests for the {@link CompassFormat} class.
 */
public class CompassFormatTest extends TestCase {

    /**
     * Returns the tests as a test suite.
     *
     * @return The test suite.
     */
    public static Test suite() {
        return new TestSuite(CompassFormatTest.class);
    }

    /**
     * Constructs a new set of tests.
     *
     * @param name  the name of the tests.
     */
    public CompassFormatTest(String name) {
        super(name);
    }

    public void testDefaultConstructor() {
        final CompassFormat fmt = new CompassFormat();
        assert("N".equals(fmt.getDirectionCode(0)));
        assert("N".equals(fmt.getDirectionCode(360)));
    }

    public void testCustomFormat() {
        final CompassFormat fmt = new CompassFormat();
        final CompassFormat fmtCustom = new CompassFormat("N", "O", "S", "W");
        assert("E".equals(fmt.getDirectionCode(90)));
        assert("O".equals(fmtCustom.getDirectionCode(90)));
        assert("NNO".equals(fmtCustom.getDirectionCode(22.5)));
    }

}

@@ -34,68 +34,50 @@
 t;%0A%0A
+%0A
 import 
-junit.framework.Test;%0Aimport junit.framework.TestCase
+org.jfree.chart.axis.CompassFormat
 ;%0Aim
@@ -85,77 +85,68 @@
 ort 
+org.
 junit.
-framework.TestSuite;%0A%0Aimport org.jfree.chart.axis.CompassFormat
+Test;%0A%0Aimport static org.junit.Assert.assertEquals
 ;%0A%0A/
@@ -233,394 +233,21 @@
 est 
-extends TestCase %7B%0A%0A    /**%0A     * Returns the tests as a test suite.%0A     *%0A     * @return The test suite.%0A     */%0A    public static Test suite() %7B%0A        return new TestSuite(CompassFormatTest.class);%0A    %7D%0A%0A    /**%0A     * Constructs a new set of tests.%0A     *%0A     * @param name  the name of the tests.%0A     */%0A    public CompassFormatTest(String name) %7B%0A        super(name);%0A    %7D%0A
+%7B%0A%0A%0A    @Test
 %0A   
@@ -351,36 +351,36 @@
       assert
-(%22N%22.e
+E
 quals(
+%22N%22, 
 fmt.getDirec
@@ -391,17 +391,16 @@
 Code(0))
-)
 ;%0A      
@@ -411,20 +411,20 @@
 sert
-(%22N%22.e
+E
 quals(
+%22N%22, 
 fmt.
@@ -445,17 +445,16 @@
 de(360))
-)
 ;%0A    %7D%0A
@@ -454,16 +454,26 @@
 %0A    %7D%0A%0A
+    @Test%0A
     publ
@@ -653,20 +653,20 @@
 sert
-(%22E%22.e
+E
 quals(
+%22E%22, 
 fmt.
@@ -678,33 +678,32 @@
 rectionCode(90))
-)
 ;%0A        assert
@@ -706,20 +706,20 @@
 sert
-(%22O%22.e
+E
 quals(
+%22O%22, 
 fmtC
@@ -745,17 +745,16 @@
 ode(90))
-)
 ;%0A      
@@ -765,22 +765,22 @@
 sert
-(%22NNO%22.equals(
+Equals(%22NNO%22, 
 fmtC
@@ -808,17 +808,16 @@
 e(22.5))
-)
 ;%0A    %7D%0A

Convert new test to Junit4 style