- Notifications
You must be signed in to change notification settings - Fork 19.9k
/
Copy pathPerfectSquareTest.java
38 lines (26 loc) · 811 Bytes
/
PerfectSquareTest.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
34
35
36
37
38
packagecom.thealgorithms.maths;
importstaticorg.junit.jupiter.api.Assertions.*;
importorg.junit.jupiter.api.Test;
publicclassPerfectSquareTest {
@Test
publicvoidTestPerfectSquareifiscorrect() {
// Valid Partition
intnumber = 9;
booleanresult = PerfectSquare.isPerfectSquare(number);
assertTrue(result);
}
@Test
publicvoidTestPerfectSquareifisnotcorrect() {
// Invalid Partition 1
intnumber = 3;
booleanresult = PerfectSquare.isPerfectSquare(number);
assertFalse(result);
}
@Test
publicvoidTestPerfectSquareifisNegativeNumber() {
// Invalid Partition 2
intnumber = -10;
booleanresult = PerfectSquare.isPerfectSquare(number);
assertFalse(result);
}
}