Skip to content

Commit 405ffbc

Browse files
authored
Fix test file package and project structure
1 parent 25b090d commit 405ffbc

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.thealgorithms.maths;
2+
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
5+
import org.junit.jupiter.api.Test;
6+
7+
class DistanceBetweenTwoPointsTest {
8+
9+
@Test
10+
void testDistanceSimple() {
11+
assertEquals(
12+
5.0,
13+
DistanceBetweenTwoPoints.calculate(0, 0, 3, 4),
14+
1e-9
15+
);
16+
}
17+
18+
@Test
19+
void testDistanceNegativeCoordinates() {
20+
assertEquals(
21+
5.0,
22+
DistanceBetweenTwoPoints.calculate(-1, -1, 2, 3),
23+
1e-9
24+
);
25+
}
26+
27+
@Test
28+
void testSamePoint() {
29+
assertEquals(
30+
0.0,
31+
DistanceBetweenTwoPoints.calculate(2, 2, 2, 2),
32+
1e-9
33+
);
34+
}
35+
}

0 commit comments

Comments
 (0)