mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-28 15:02:46 +08:00
Format code with prettier (#3375)
This commit is contained in:
@ -1,11 +1,10 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class CollatzConjectureTest {
|
||||
|
||||
@ -28,13 +27,34 @@ class CollatzConjectureTest {
|
||||
|
||||
@Test
|
||||
void collatzConjecture() {
|
||||
final List<Integer> expected = List.of(35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1);
|
||||
final List<Integer> expected = List.of(
|
||||
35,
|
||||
106,
|
||||
53,
|
||||
160,
|
||||
80,
|
||||
40,
|
||||
20,
|
||||
10,
|
||||
5,
|
||||
16,
|
||||
8,
|
||||
4,
|
||||
2,
|
||||
1
|
||||
);
|
||||
assertIterableEquals(expected, cConjecture.collatzConjecture(35));
|
||||
}
|
||||
|
||||
@Test
|
||||
void sequenceOfNotNaturalFirstNumber() {
|
||||
assertThrows(IllegalArgumentException.class, () -> cConjecture.collatzConjecture(0));
|
||||
assertThrows(IllegalArgumentException.class, () -> cConjecture.collatzConjecture(-1));
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> cConjecture.collatzConjecture(0)
|
||||
);
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> cConjecture.collatzConjecture(-1)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user