style: include UTAO_JUNIT_ASSERTION_ODDITIES_USE_ASSERT_NULL (#7225)

This commit is contained in:
Piotr Idzik
2026-01-20 22:02:10 +01:00
committed by GitHub
parent ba5ccbe0c7
commit 1b014a2ea4
4 changed files with 9 additions and 12 deletions

View File

@@ -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