TestNums.java 673 B

12345678910111213141516171819202122232425262728293031
  1. import org.testng.Assert;
  2. import org.testng.annotations.Test;
  3. public class TestNums {
  4. Nums myNumObj = new Nums();
  5. @Test
  6. public void testTrue() {
  7. myNumObj.setValue(10);
  8. boolean isBigger = myNumObj.isBiggerThanFive();
  9. Assert.assertEquals(true, isBigger, "10 should be bigger than 5");
  10. }
  11. @Test
  12. public void testFalse() {
  13. myNumObj.setValue(1);
  14. boolean isBigger = myNumObj.isBiggerThanFive();
  15. Assert.assertEquals(false, isBigger, "1 should be smaller than 5");
  16. }
  17. @Test
  18. public void testBoundary() {
  19. myNumObj.setValue(5);
  20. boolean isBigger = myNumObj.isBiggerThanFive();
  21. Assert.assertEquals(false, isBigger, "5 should not be bigger than 5");
  22. }
  23. }