123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
-
-
- import static org.junit.Assert.*;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
-
- /**
- * The test class PredicateUtilitiesTest.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class PredicateUtilitiesTest
- {
- private PredicateUtilities math;
- /**
- * Default constructor for test class PredicateUtilitiesTest
- */
- public PredicateUtilitiesTest()
- {
- math = new PredicateUtilities();
- }
-
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- */
- @Before
- public void setUp()
- {
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- @After
- public void tearDown()
- {
- }
-
- @Test
- public void testGreaterThanTrue() {
- // : Given
- int greaterValue = 450;
- int lesserValue = 350;
-
-
- // : When
- boolean outcome = math.isGreaterThan(greaterValue, lesserValue);
-
- // : Then
- assertTrue(outcome);
- }
-
-
- @Test
- public void testGreaterThanFalse() {
- // : Given
- int greaterValue = 350;
- int lesserValue = 350;
-
- // : When
- boolean outcome = math.isGreaterThan(greaterValue, lesserValue);
-
- // : Then
- assertFalse(outcome);
- }
-
-
- @Test
- public void testLessThanTrue() {
- // : Given
- int greaterValue = 450;
- int lesserValue = 350;
-
- // : When
- boolean outcome = math.isLessThan(greaterValue, lesserValue);
-
- // : Then
- assertFalse(outcome);
- }
-
-
- @Test
- public void testLessThan1() {
- // : Given
- int greaterValue = 450;
- int lesserValue = 350;
-
- // : When
- boolean outcome = math.isLessThan(greaterValue, lesserValue);
-
- // : Then
- assertFalse(outcome);
- }
-
-
- @Test
- public void testLessOrEqual1() {
- // : Given
- int greaterValue = 3;
- int lesserValue = 3;
-
- // : When
- boolean outcome = math.isLessThanOrEqualTo(greaterValue, lesserValue);
-
- // : Then
- assertTrue(outcome);
- }
-
- @Test
- public void testLessOrEqual2() {
- // : Given
- int greaterValue = 3;
- int lesserValue = 6;
-
- // : When
- boolean outcome = math.isLessThanOrEqualTo(greaterValue, lesserValue);
-
- // : Then
- assertTrue(outcome);
- }
-
- @Test
- public void testGreaterOrEqual1() {
- // : Given
- int greaterValue = 4;
- int lesserValue = 4;
-
- // : When
- boolean outcome = math.isGreaterThanOrEqualTo(greaterValue, lesserValue);
-
- // : ThenP
- assertTrue(outcome);
- }
-
-
- @Test
- public void testGreaterOrEqual2() {
- // : Given
- int greaterValue = 8;
- int lesserValue = 15;
-
- // : When
- boolean outcome = math.isGreaterThanOrEqualTo(greaterValue, lesserValue);
-
- // : Then
- assertFalse(outcome);
- }
- }
|