示例#1
0
 @Test
 public void testCustomFormat() {
   final CompassFormat fmt = new CompassFormat();
   final CompassFormat fmtCustom = new CompassFormat("N", "O", "S", "W");
   assertEquals("E", fmt.getDirectionCode(90));
   assertEquals("O", fmtCustom.getDirectionCode(90));
   assertEquals("NNO", fmtCustom.getDirectionCode(22.5));
 }
示例#2
0
 @Test
 public void testDefaultConstructor() {
   final CompassFormat fmt = new CompassFormat();
   assertEquals("N", fmt.getDirectionCode(0));
   assertEquals("N", fmt.getDirectionCode(360));
 }