mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
style: resolve some of the UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_EQUALS warnings (#7240)
This commit is contained in:
@@ -28,16 +28,16 @@ public class CombinationTest {
|
||||
@Test
|
||||
void testLengthOne() {
|
||||
List<TreeSet<Integer>> result = Combination.combination(new Integer[] {1, 2}, 1);
|
||||
assertTrue(result.get(0).iterator().next() == 1);
|
||||
assertTrue(result.get(1).iterator().next() == 2);
|
||||
assertEquals(1, result.get(0).iterator().next());
|
||||
assertEquals(2, result.get(1).iterator().next());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testLengthTwo() {
|
||||
List<TreeSet<Integer>> result = Combination.combination(new Integer[] {1, 2}, 2);
|
||||
Integer[] arr = result.get(0).toArray(new Integer[2]);
|
||||
assertTrue(arr[0] == 1);
|
||||
assertTrue(arr[1] == 2);
|
||||
assertEquals(1, arr[0]);
|
||||
assertEquals(2, arr[1]);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.misc;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
@@ -67,7 +68,7 @@ public class ShuffleArrayTest {
|
||||
ShuffleArray.shuffle(arr);
|
||||
|
||||
// Check that the shuffled array contains the same elements
|
||||
assertTrue(arr.length == 5);
|
||||
assertEquals(5, arr.length);
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
assertTrue(contains(arr, i));
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public class PasswordGenTest {
|
||||
@Test
|
||||
public void generateOneCharacterPassword() {
|
||||
String tempPassword = PasswordGen.generatePassword(1, 2);
|
||||
assertTrue(tempPassword.length() == 1);
|
||||
assertEquals(1, tempPassword.length());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user