import org.testng.Assert; boolean isNegative(int num) { return num < 0; } @Test public void testIsNegative() { int num = -5; Assert.assertFalse(isNegative(num)); }
import org.testng.Assert; @Test public void testIsOdd() { int num = 2; Assert.assertFalse(num % 2 == 1, "Even numbers should not be odd."); }
org.testng testng 7.4.0
dependencies { testImplementation 'org.testng:testng:7.4.0' }