[Mercator]: Unit test fixes

This commit is contained in:
Grigorios Dimopoulos 2018-11-05 11:04:44 +02:00
parent f2d957e4d7
commit 80357224ac
2 changed files with 10 additions and 9 deletions

View File

@ -1,21 +1,22 @@
package com.baeldung.algorithms.mercator;
import org.junit.Assert;
import org.junit.Test;
public class EllipticalMercatorUnitTest {
@Test
public void givenThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() {
public void giventThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() {
Mercator mercator = new EllipticalMercator();
double result = mercator.xAxisProjection(22);
assert result == 2449028.7974520186;
Assert.assertEquals(result, 2449028.7974520186, 0.0);
}
@Test
public void givenThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() {
public void giventThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() {
Mercator mercator = new EllipticalMercator();
double result = mercator.yAxisProjection(44);
assert result == 5435749.887511954;
Assert.assertEquals(result, 5435749.887511954, 0.0);
}
}

View File

@ -1,21 +1,21 @@
package com.baeldung.algorithms.mercator;
import org.junit.Assert;
import org.junit.Test;
import static junit.framework.TestCase.assertEquals;
public class SphericalMercatorUnitTest {
@Test
public void givenThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() {
public void giventThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() {
Mercator mercator = new SphericalMercator();
double result = mercator.xAxisProjection(22);
assert result == 2449028.7974520186;
Assert.assertEquals(result, 2449028.7974520186, 0.0);
}
@Test
public void givenThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() {
public void giventThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() {
Mercator mercator = new SphericalMercator();
double result = mercator.yAxisProjection(44);
assert result == 5465442.183322753;
Assert.assertEquals(result, 5465442.183322753, 0.0);
}
}