123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
-
-
- import org.junit.Test;
-
- import static org.junit.Assert.*;
-
- /**
- * Created by dan on 6/14/17.
- */
- public class PredicateUtilitiesTest {
- private static volatile PredicateUtilities predicateUtils = new PredicateUtilities();
-
- @Test
- public void testGreaterThanTrue() {
- // : Given
- int greaterValue = 450;
- int lesserValue = 350;
-
-
- // : When
- boolean outcome = predicateUtils.isGreaterThan(greaterValue, lesserValue);
-
- // : Then
- assertTrue(outcome);
- }
-
-
- @Test
- public void testGreaterThanFalse() {
- // : Given
- int greaterValue = 350;
- int lesserValue = 350;
-
- // : When
- boolean outcome = predicateUtils.isGreaterThan(greaterValue, lesserValue);
-
- // : Then
- assertFalse(outcome);
- }
-
-
- @Test
- public void testLessThanTrue() {
- // : Given
- int greaterValue = 450;
- int lesserValue = 350;
-
- // : When
- boolean outcome = predicateUtils.isLessThan(greaterValue, lesserValue);
-
- // : Then
- assertFalse(outcome);
- }
-
-
- @Test
- public void testLessThan1() {
- // : Given
- int greaterValue = 450;
- int lesserValue = 350;
-
- // : When
- boolean outcome = predicateUtils.isLessThan(greaterValue, lesserValue);
-
- // : Then
- assertFalse(outcome);
- }
-
-
- @Test
- public void testLessOrEqual1() {
- // : Given
- int greaterValue = 3;
- int lesserValue = 3;
-
- // : When
- boolean outcome = predicateUtils.isLessThanOrEqualTo(greaterValue, lesserValue);
-
- // : Then
- assertTrue(outcome);
- }
-
- @Test
- public void testLessOrEqual2() {
- // : Given
- int greaterValue = 3;
- int lesserValue = 6;
-
- // : When
- boolean outcome = predicateUtils.isLessThanOrEqualTo(greaterValue, lesserValue);
-
- // : Then
- assertTrue(outcome);
- }
-
- @Test
- public void testGreaterOrEqual1() {
- // : Given
- int greaterValue = 4;
- int lesserValue = 4;
-
- // : When
- boolean outcome = predicateUtils.isGreaterThanOrEqualTo(greaterValue, lesserValue);
-
- // : ThenP
- assertTrue(outcome);
- }
-
-
- @Test
- public void testGreaterOrEqual2() {
- // : Given
- int greaterValue = 8;
- int lesserValue = 15;
-
- // : When
- boolean outcome = predicateUtils.isGreaterThanOrEqualTo(greaterValue, lesserValue);
-
- // : Then
- assertFalse(outcome);
- }
-
- @Test
- public void testReturnTrue() {
- assertTrue(predicateUtils.returnTrue());
- }
-
-
- @Test
- public void testReturnFalse() {
- assertFalse(predicateUtils.returnFalse());
- }
- }
|