style: include NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION (#5149)

* style: use `assertFalse` and `assertTrue`

* style: include `NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION`
This commit is contained in:
Piotr Idzik
2024-05-08 19:11:46 +02:00
committed by GitHub
parent d3bb691f59
commit d2ddec55e5
11 changed files with 47 additions and 43 deletions

View File

@ -1,6 +1,7 @@
package com.thealgorithms.others;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
@ -10,34 +11,34 @@ public class TwoPointersTest {
void twoPointersFirstTestCase() {
int[] arr = {2, 6, 9, 22, 121};
int key = 28;
assertEquals(true, TwoPointers.isPairedSum(arr, key));
assertTrue(TwoPointers.isPairedSum(arr, key));
}
@Test
void twoPointersSecondTestCase() {
int[] arr = {-1, -12, 12, 0, 8};
int key = 0;
assertEquals(true, TwoPointers.isPairedSum(arr, key));
assertTrue(TwoPointers.isPairedSum(arr, key));
}
@Test
void twoPointersThirdTestCase() {
int[] arr = {12, 35, 12, 152, 0};
int key = 13;
assertEquals(false, TwoPointers.isPairedSum(arr, key));
assertFalse(TwoPointers.isPairedSum(arr, key));
}
@Test
void twoPointersFourthTestCase() {
int[] arr = {-2, 5, -1, 52, 31};
int key = -3;
assertEquals(true, TwoPointers.isPairedSum(arr, key));
assertTrue(TwoPointers.isPairedSum(arr, key));
}
@Test
void twoPointersFiftiethTestCase() {
int[] arr = {25, 1, 0, 61, 21};
int key = 12;
assertEquals(false, TwoPointers.isPairedSum(arr, key));
assertFalse(TwoPointers.isPairedSum(arr, key));
}
}