|
1 | 1 | package com.thealgorithms.maths; |
2 | 2 |
|
3 | | -import static com.thealgorithms.maths.VampireNumber.isVampireNumber; |
4 | | -import static com.thealgorithms.maths.VampireNumber.splitIntoSortedDigits; |
5 | | -import static org.junit.jupiter.api.Assertions.assertEquals; |
6 | | -import static org.junit.jupiter.api.Assertions.assertFalse; |
7 | | -import static org.junit.jupiter.api.Assertions.assertTrue; |
8 | | - |
| 3 | +import org.junit.jupiter.api.Assertions; |
9 | 4 | import org.junit.jupiter.api.Test; |
10 | 5 |
|
11 | 6 | class VampireNumberTest { |
12 | 7 | @Test |
13 | 8 | void areVampireNumbers() { |
14 | | - assertTrue(isVampireNumber(15, 93, true)); |
15 | | - assertTrue(isVampireNumber(135, 801, true)); |
16 | | - assertTrue(isVampireNumber(201, 600, true)); |
| 9 | + Assertions.assertTrue(VampireNumber.isVampireNumber(15, 93, true)); |
| 10 | + Assertions.assertTrue(VampireNumber.isVampireNumber(135, 801, true)); |
| 11 | + Assertions.assertTrue(VampireNumber.isVampireNumber(201, 600, true)); |
17 | 12 | } |
18 | 13 |
|
19 | 14 | @Test |
20 | 15 | void arePseudoVampireNumbers() { |
21 | | - assertTrue(isVampireNumber(150, 93, false)); |
22 | | - assertTrue(isVampireNumber(546, 84, false)); |
23 | | - assertTrue(isVampireNumber(641, 65, false)); |
| 16 | + Assertions.assertTrue(VampireNumber.isVampireNumber(150, 93, false)); |
| 17 | + Assertions.assertTrue(VampireNumber.isVampireNumber(546, 84, false)); |
| 18 | + Assertions.assertTrue(VampireNumber.isVampireNumber(641, 65, false)); |
24 | 19 | } |
25 | 20 |
|
26 | 21 | @Test |
27 | 22 | void areNotVampireNumbers() { |
28 | | - assertFalse(isVampireNumber(51, 39, false)); |
29 | | - assertFalse(isVampireNumber(51, 39, true)); |
| 23 | + Assertions.assertFalse(VampireNumber.isVampireNumber(51, 39, false)); |
| 24 | + Assertions.assertFalse(VampireNumber.isVampireNumber(51, 39, true)); |
30 | 25 | } |
31 | 26 |
|
32 | 27 | @Test |
33 | 28 | void testSplitIntoSortedDigits() { |
34 | | - assertEquals("123", splitIntoSortedDigits(321)); |
35 | | - assertEquals("02234", splitIntoSortedDigits(20, 324)); |
| 29 | + Assertions.assertEquals("123", VampireNumber.splitIntoSortedDigits(321)); |
| 30 | + Assertions.assertEquals("02234", VampireNumber.splitIntoSortedDigits(20, 324)); |
36 | 31 | } |
37 | 32 | } |
0 commit comments