-
Notifications
You must be signed in to change notification settings - Fork 19.4k
/
PerfectCubeTest.java
33 lines (28 loc) · 1.47 KB
/
PerfectCubeTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.thealgorithms.maths;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
class PerfectCubeTest {
@Test
public void perfectCube() {
Assertions.assertTrue(PerfectCube.isPerfectCube(-27));
Assertions.assertTrue(PerfectCube.isPerfectCubeMathCbrt(-27));
Assertions.assertTrue(PerfectCube.isPerfectCube(-1));
Assertions.assertTrue(PerfectCube.isPerfectCubeMathCbrt(-1));
Assertions.assertTrue(PerfectCube.isPerfectCube(0));
Assertions.assertTrue(PerfectCube.isPerfectCubeMathCbrt(0));
Assertions.assertTrue(PerfectCube.isPerfectCube(1));
Assertions.assertTrue(PerfectCube.isPerfectCubeMathCbrt(1));
Assertions.assertTrue(PerfectCube.isPerfectCube(8));
Assertions.assertTrue(PerfectCube.isPerfectCubeMathCbrt(8));
Assertions.assertTrue(PerfectCube.isPerfectCube(27));
Assertions.assertTrue(PerfectCube.isPerfectCubeMathCbrt(27));
Assertions.assertFalse(PerfectCube.isPerfectCube(-9));
Assertions.assertFalse(PerfectCube.isPerfectCubeMathCbrt(-9));
Assertions.assertFalse(PerfectCube.isPerfectCube(2));
Assertions.assertFalse(PerfectCube.isPerfectCubeMathCbrt(2));
Assertions.assertFalse(PerfectCube.isPerfectCube(4));
Assertions.assertFalse(PerfectCube.isPerfectCubeMathCbrt(4));
Assertions.assertFalse(PerfectCube.isPerfectCube(30));
Assertions.assertFalse(PerfectCube.isPerfectCubeMathCbrt(30));
}
}