TestPredicateUtilities.java 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. import org.junit.Test;
  2. import static org.junit.Assert.*;
  3. /**
  4. * Created by dan on 6/14/17.
  5. */
  6. public class TestPredicateUtilities {
  7. private static volatile PredicateUtilities math = new PredicateUtilities();
  8. @Test
  9. public void testGreaterThanTrue() {
  10. // : Given
  11. int greaterValue = 450;
  12. int lesserValue = 350;
  13. // : When
  14. boolean outcome = math.isGreaterThan(greaterValue, lesserValue);
  15. // : Then
  16. assertTrue(outcome);
  17. }
  18. @Test
  19. public void testGreaterThanFalse() {
  20. // : Given
  21. int greaterValue = 350;
  22. int lesserValue = 350;
  23. // : When
  24. boolean outcome = math.isGreaterThan(greaterValue, lesserValue);
  25. // : Then
  26. assertFalse(outcome);
  27. }
  28. @Test
  29. public void testLessThanTrue() {
  30. // : Given
  31. int greaterValue = 450;
  32. int lesserValue = 350;
  33. // : When
  34. boolean outcome = math.isLessThan(greaterValue, lesserValue);
  35. // : Then
  36. assertFalse(outcome);
  37. }
  38. @Test
  39. public void testLessThan1() {
  40. // : Given
  41. int greaterValue = 450;
  42. int lesserValue = 350;
  43. // : When
  44. boolean outcome = math.isLessThan(greaterValue, lesserValue);
  45. // : Then
  46. assertFalse(outcome);
  47. }
  48. @Test
  49. public void testLessOrEqual1() {
  50. // : Given
  51. int greaterValue = 3;
  52. int lesserValue = 3;
  53. // : When
  54. boolean outcome = math.isLessThanOrEqualTo(greaterValue, lesserValue);
  55. // : Then
  56. assertTrue(outcome);
  57. }
  58. @Test
  59. public void testLessOrEqual2() {
  60. // : Given
  61. int greaterValue = 3;
  62. int lesserValue = 6;
  63. // : When
  64. boolean outcome = math.isLessThanOrEqualTo(greaterValue, lesserValue);
  65. // : Then
  66. assertTrue(outcome);
  67. }
  68. @Test
  69. public void testGreaterOrEqual1() {
  70. // : Given
  71. int greaterValue = 4;
  72. int lesserValue = 4;
  73. // : When
  74. boolean outcome = math.isGreaterThanOrEqualTo(greaterValue, lesserValue);
  75. // : ThenP
  76. assertTrue(outcome);
  77. }
  78. @Test
  79. public void testGreaterOrEqual2() {
  80. // : Given
  81. int greaterValue = 8;
  82. int lesserValue = 15;
  83. // : When
  84. boolean outcome = math.isGreaterThanOrEqualTo(greaterValue, lesserValue);
  85. // : Then
  86. assertFalse(outcome);
  87. }
  88. }