Skip to content

Commit 8035722

Browse files
[Mercator]: Unit test fixes
1 parent f2d957e commit 8035722

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
package com.baeldung.algorithms.mercator;
22

3+
import org.junit.Assert;
34
import org.junit.Test;
45

56

67
public class EllipticalMercatorUnitTest {
78

89
@Test
9-
public void givenThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() {
10+
public void giventThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() {
1011
Mercator mercator = new EllipticalMercator();
1112
double result = mercator.xAxisProjection(22);
12-
assert result == 2449028.7974520186;
13+
Assert.assertEquals(result, 2449028.7974520186, 0.0);
1314
}
1415

1516
@Test
16-
public void givenThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() {
17+
public void giventThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() {
1718
Mercator mercator = new EllipticalMercator();
1819
double result = mercator.yAxisProjection(44);
19-
assert result == 5435749.887511954;
20+
Assert.assertEquals(result, 5435749.887511954, 0.0);
2021
}
2122
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
package com.baeldung.algorithms.mercator;
22

3+
import org.junit.Assert;
34
import org.junit.Test;
4-
import static junit.framework.TestCase.assertEquals;
55

66
public class SphericalMercatorUnitTest {
77

88
@Test
9-
public void givenThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() {
9+
public void giventThatTheInputIs22_whenXAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() {
1010
Mercator mercator = new SphericalMercator();
1111
double result = mercator.xAxisProjection(22);
12-
assert result == 2449028.7974520186;
12+
Assert.assertEquals(result, 2449028.7974520186, 0.0);
1313
}
1414

1515
@Test
16-
public void givenThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() {
16+
public void giventThatTheInputIs44_whenYAxisProjectionIsCalled_thenTheResultIsTheCorrectOne() {
1717
Mercator mercator = new SphericalMercator();
1818
double result = mercator.yAxisProjection(44);
19-
assert result == 5465442.183322753;
19+
Assert.assertEquals(result, 5465442.183322753, 0.0);
2020
}
2121
}

0 commit comments

Comments
 (0)