mirror of
https://github.com/TheAlgorithms/Java.git
synced 2026-03-13 08:40:43 +08:00
style: include UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NULL (#7225)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.ciphers;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -121,8 +122,8 @@ class PermutationCipherTest {
|
||||
String decrypted = cipher.decrypt(encrypted, key);
|
||||
|
||||
// then
|
||||
assertEquals(null, encrypted);
|
||||
assertEquals(null, decrypted);
|
||||
assertNull(encrypted);
|
||||
assertNull(decrypted);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.thealgorithms.datastructures.trees;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -30,7 +31,7 @@ public class TreapTest {
|
||||
treap.insert(3);
|
||||
treap.insert(8);
|
||||
treap.insert(1);
|
||||
assertEquals(null, treap.search(4));
|
||||
assertNull(treap.search(4));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.dynamicprogramming;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -55,27 +56,24 @@ public class LongestCommonSubsequenceTest {
|
||||
public void testLCSWithNullFirstString() {
|
||||
String str1 = null;
|
||||
String str2 = "XYZ";
|
||||
String expected = null; // Should return null if first string is null
|
||||
String result = LongestCommonSubsequence.getLCS(str1, str2);
|
||||
assertEquals(expected, result);
|
||||
assertNull(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLCSWithNullSecondString() {
|
||||
String str1 = "ABC";
|
||||
String str2 = null;
|
||||
String expected = null; // Should return null if second string is null
|
||||
String result = LongestCommonSubsequence.getLCS(str1, str2);
|
||||
assertEquals(expected, result);
|
||||
assertNull(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLCSWithNullBothStrings() {
|
||||
String str1 = null;
|
||||
String str2 = null;
|
||||
String expected = null; // Should return null if both strings are null
|
||||
String result = LongestCommonSubsequence.getLCS(str1, str2);
|
||||
assertEquals(expected, result);
|
||||
assertNull(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user