Browse Source

first commit

Leon 6 years ago
parent
commit
9aeab377a6
23 changed files with 269 additions and 229 deletions
  1. 0
    11
      src/main/java/com/zipcodewilmington/danny_do_better/HelloWorld.java
  2. 0
    41
      src/main/java/com/zipcodewilmington/danny_do_better/MathUtilities.java
  3. 0
    55
      src/main/java/com/zipcodewilmington/danny_do_better/StringUtilities.java
  4. 13
    0
      src/main/java/com/zipcodewilmington/danny_do_better_exercises/HelloWorld.java
  5. 42
    0
      src/main/java/com/zipcodewilmington/danny_do_better_exercises/PredicateUtilities.java
  6. 54
    54
      src/main/java/com/zipcodewilmington/danny_do_better_exercises/PrimitiveTypes.java
  7. 82
    0
      src/main/java/com/zipcodewilmington/danny_do_better_exercises/StringUtilities.java
  8. 1
    1
      src/test/java/com/zipcodewilmington/danny_do_better_exercises/HelloWorldTest.java
  9. 43
    49
      src/test/java/com/zipcodewilmington/danny_do_better_exercises/PredicateUtilitiesTest.java
  10. 2
    2
      src/test/java/com/zipcodewilmington/danny_do_better_exercises/PrimativeTypesTest.java
  11. 14
    16
      src/test/java/com/zipcodewilmington/danny_do_better_exercises/StringUtilitiesTest.java
  12. 18
    0
      src/test/java/com/zipcodewilmington/danny_do_better_exercises/TestSuite.java
  13. BIN
      target/classes/com/zipcodewilmington/danny_do_better/MathUtilities.class
  14. BIN
      target/classes/com/zipcodewilmington/danny_do_better/PredicateUtilities.class
  15. BIN
      target/classes/com/zipcodewilmington/danny_do_better/PrimativeTypes.class
  16. BIN
      target/classes/com/zipcodewilmington/danny_do_better/PrimitiveTypes.class
  17. BIN
      target/classes/com/zipcodewilmington/danny_do_better/StringUtilities.class
  18. BIN
      target/test-classes/com/zipcodewilmington/danny_do_better/HelloWorldTest.class
  19. BIN
      target/test-classes/com/zipcodewilmington/danny_do_better/MathUtilitiesTest.class
  20. BIN
      target/test-classes/com/zipcodewilmington/danny_do_better/PredicateUtilitiesTest.class
  21. BIN
      target/test-classes/com/zipcodewilmington/danny_do_better/PrimativeTypesTest.class
  22. BIN
      target/test-classes/com/zipcodewilmington/danny_do_better/StringUtilitiesTest.class
  23. BIN
      target/test-classes/com/zipcodewilmington/danny_do_better/TestSuite.class

+ 0
- 11
src/main/java/com/zipcodewilmington/danny_do_better/HelloWorld.java View File

@@ -1,11 +0,0 @@
1
-package com.zipcodewilmington.danny_do_better;
2
-
3
-/**
4
- * Created by leon on 2/1/18.
5
- */
6
-public class HelloWorld {
7
-    //Should return `Hello World` as a string
8
-    public String helloWorld(){
9
-        return null;
10
-    }
11
-}

+ 0
- 41
src/main/java/com/zipcodewilmington/danny_do_better/MathUtilities.java View File

@@ -1,41 +0,0 @@
1
-package com.zipcodewilmington.danny_do_better;
2
-
3
-/**
4
- * Created by dan on 6/14/17.
5
- */
6
-public class MathUtilities {
7
-    //Get the remainder from division
8
-    public int remainder(int dividend, int divisor){
9
-        return 0;
10
-    }
11
-
12
-    //Evaluate the equality of `greaterValue` and `lesserValue` using greater than operation.
13
-    public boolean isGreaterThan(int greaterValue, int lesserValue){
14
-        return greaterValue > lesserValue;
15
-    }
16
-
17
-    //Return true using less than symbol
18
-    public boolean isLessThan(int greaterValue, int lesserValue){
19
-        return false;
20
-    }
21
-
22
-    //Return true using greater or equal symbol
23
-    public boolean isGreaterThanOrEqualTo(int greaterValue, int lesserValue){
24
-        return false;
25
-    }
26
-
27
-    //Return true using less than or equal symbol
28
-    public boolean isLessThanOrEqualTo(int greaterValue, int lesserValue){
29
-        return false;
30
-    }
31
-
32
-    //Return true if the number in parameter is equal to 3 and less than 90
33
-    public boolean isBoth(Integer number){
34
-        return false;
35
-    }
36
-
37
-    //Return true if the number passed in is equal to 4 or greater than 100
38
-    public boolean logicalOr(Integer number){
39
-        return false;
40
-    }
41
-}

+ 0
- 55
src/main/java/com/zipcodewilmington/danny_do_better/StringUtilities.java View File

@@ -1,55 +0,0 @@
1
-package com.zipcodewilmington.danny_do_better;
2
-
3
-/**
4
- * Created by dan on 6/14/17.
5
- */
6
-public class StringUtilities {
7
-
8
-    // Return the concatenation of two strings, `firstSegment`, and `secondSegment`
9
-    public String concatenation(String firstSegment, String secondSegment){
10
-        return null;
11
-    }
12
-
13
-    // Return the concatenation of an integer and a string, `firstSegment`, and `secondSegment`
14
-    public String concatenation(int firstSegment, String secondSegment){
15
-        return null;
16
-    }
17
-
18
-    // Return a substring of the first three characters of a string
19
-    public String getPrefix(String input){
20
-        return null;
21
-    }
22
-
23
-    // Return a substring of the last three characters of a string
24
-    public String getSuffix(String input){
25
-        return null;
26
-    }
27
-
28
-    // Return the equivalence of two strings as a boolean
29
-    public boolean compareTwoStrings(String inputValue, String comparableValue){
30
-        return false;
31
-    }
32
-
33
-    // Return the center character of a provided string
34
-    public Character getMiddleCharacter(String input){
35
-        int length = input.length();
36
-        int centerIndex = length /2;
37
-        char centerCharacter = input.charAt(centerIndex);
38
-        return centerCharacter;
39
-    }
40
-
41
-    // Return the first word of a string delimited by spaces.
42
-    public String getFirstWord(String spaceDelimitedString){
43
-        return null;
44
-    }
45
-
46
-    // Return the second word of a string delimited by spaces.
47
-    public String getTheSecondWord(String spaceDelimitedString){
48
-        return null;
49
-    }
50
-
51
-    // Return an identical string with characters in reverse order.
52
-    public String reverseTheTwo(String stringToReverse){
53
-        return null;
54
-    }
55
-}

+ 13
- 0
src/main/java/com/zipcodewilmington/danny_do_better_exercises/HelloWorld.java View File

@@ -0,0 +1,13 @@
1
+package com.zipcodewilmington.danny_do_better_exercises;
2
+
3
+/**
4
+ * Created by leon on 2/1/18.
5
+ */
6
+public class HelloWorld {
7
+    /**
8
+     * @return 'Hello World' as a string
9
+     */
10
+    public String toString(){
11
+        return null;
12
+    }
13
+}

+ 42
- 0
src/main/java/com/zipcodewilmington/danny_do_better_exercises/PredicateUtilities.java View File

@@ -0,0 +1,42 @@
1
+package com.zipcodewilmington.danny_do_better_exercises;
2
+
3
+/**
4
+ * Created by dan on 6/14/17.
5
+ */
6
+public class PredicateUtilities {
7
+    /**
8
+     * @param x
9
+     * @param y
10
+     * @return true if `x` is greater than `y`
11
+     */
12
+    public Boolean isGreaterThan(int x, int y) {
13
+        return null;
14
+    }
15
+
16
+    /**
17
+     * @param x
18
+     * @param y
19
+     * @return true if `x` is less than `y`
20
+     */
21
+    public Boolean isLessThan(int x, int y) {
22
+        return null;
23
+    }
24
+
25
+    /**
26
+     * @param x
27
+     * @param y
28
+     * @return true if `x` is greater than or equal to `y`
29
+     */
30
+    public Boolean isGreaterThanOrEqualTo(int x, int y) {
31
+        return null;
32
+    }
33
+
34
+    /**
35
+     * @param x
36
+     * @param y
37
+     * @return true if `x` is less than or equal to `y`
38
+     */
39
+    public Boolean isLessThanOrEqualTo(int x, int y) {
40
+        return null;
41
+    }
42
+}

src/main/java/com/zipcodewilmington/danny_do_better/PrimativeTypes.java → src/main/java/com/zipcodewilmington/danny_do_better_exercises/PrimitiveTypes.java View File

@@ -1,17 +1,17 @@
1
-package com.zipcodewilmington.danny_do_better;
1
+package com.zipcodewilmington.danny_do_better_exercises;
2 2
 
3 3
 /**
4 4
  * Created by dan on 6/14/17.
5 5
  */
6
-public class PrimativeTypes {
6
+public class PrimitiveTypes {
7 7
 
8 8
     /**
9 9
      * @param baseValue  starting value
10 10
      * @param difference value to add to starting value
11 11
      * @return sum of `baseValue` and `difference`
12 12
      */
13
-    public int add(int baseValue, int difference) {
14
-        return 0;
13
+    public Integer add(int baseValue, int difference) {
14
+        return null;
15 15
     }
16 16
 
17 17
     /**
@@ -19,8 +19,8 @@ public class PrimativeTypes {
19 19
      * @param difference value to add to starting value
20 20
      * @return sum of `baseValue` and `difference`
21 21
      */
22
-    public long add(long baseValue, long difference) {
23
-        return 0;
22
+    public Long add(long baseValue, long difference) {
23
+        return null;
24 24
     }
25 25
 
26 26
     /**
@@ -28,8 +28,8 @@ public class PrimativeTypes {
28 28
      * @param difference value to add to starting value
29 29
      * @return sum of `baseValue` and `difference`
30 30
      */
31
-    public short add(short baseValue, short difference) {
32
-        return 0;
31
+    public Short add(short baseValue, short difference) {
32
+        return null;
33 33
     }
34 34
 
35 35
     /**
@@ -37,8 +37,8 @@ public class PrimativeTypes {
37 37
      * @param difference value to add to starting value
38 38
      * @return sum of `baseValue` and `difference`
39 39
      */
40
-    public byte add(byte baseValue, byte difference) {
41
-        return 0;
40
+    public Byte add(byte baseValue, byte difference) {
41
+        return null;
42 42
     }
43 43
 
44 44
     /**
@@ -46,8 +46,8 @@ public class PrimativeTypes {
46 46
      * @param difference value to add to starting value
47 47
      * @return sum of `baseValue` and `difference`
48 48
      */
49
-    public float add(float baseValue, float difference) {
50
-        return 0;
49
+    public Float add(float baseValue, float difference) {
50
+        return null;
51 51
     }
52 52
 
53 53
     /**
@@ -55,8 +55,8 @@ public class PrimativeTypes {
55 55
      * @param difference value to add to starting value
56 56
      * @return sum of `baseValue` and `difference`
57 57
      */
58
-    public double add(double baseValue, double difference) {
59
-        return 0;
58
+    public Double add(double baseValue, double difference) {
59
+        return null;
60 60
     }
61 61
 
62 62
     /**
@@ -64,8 +64,8 @@ public class PrimativeTypes {
64 64
      * @param difference value to subtract from starting value
65 65
      * @return difference between `baseValue` and `difference`
66 66
      */
67
-    public int subtract(int baseValue, int difference) {
68
-        return 0;
67
+    public Integer subtract(int baseValue, int difference) {
68
+        return null;
69 69
     }
70 70
 
71 71
     /**
@@ -73,8 +73,8 @@ public class PrimativeTypes {
73 73
      * @param difference value to subtract from starting value
74 74
      * @return difference between `baseValue` and `difference`
75 75
      */
76
-    public long subtract(long baseValue, long difference) {
77
-        return 0;
76
+    public Long subtract(long baseValue, long difference) {
77
+        return null;
78 78
     }
79 79
 
80 80
     /**
@@ -82,8 +82,8 @@ public class PrimativeTypes {
82 82
      * @param difference value to subtract from starting value
83 83
      * @return difference between `baseValue` and `difference`
84 84
      */
85
-    public short subtract(short baseValue, short difference) {
86
-        return 0;
85
+    public Short subtract(short baseValue, short difference) {
86
+        return null;
87 87
     }
88 88
 
89 89
     /**
@@ -91,8 +91,8 @@ public class PrimativeTypes {
91 91
      * @param difference value to subtract from starting value
92 92
      * @return difference between `baseValue` and `difference`
93 93
      */
94
-    public byte subtract(byte baseValue, byte difference) {
95
-        return 0;
94
+    public Byte subtract(byte baseValue, byte difference) {
95
+        return null;
96 96
     }
97 97
 
98 98
     /**
@@ -100,8 +100,8 @@ public class PrimativeTypes {
100 100
      * @param difference value to subtract from starting value
101 101
      * @return difference between `baseValue` and `difference`
102 102
      */
103
-    public float subtract(float baseValue, float difference) {
104
-        return 0;
103
+    public Float subtract(float baseValue, float difference) {
104
+        return null;
105 105
     }
106 106
 
107 107
     /**
@@ -109,8 +109,8 @@ public class PrimativeTypes {
109 109
      * @param difference value to subtract from starting value
110 110
      * @return difference between `baseValue` and `difference`
111 111
      */
112
-    public double subtract(double baseValue, double difference) {
113
-        return 0;
112
+    public Double subtract(double baseValue, double difference) {
113
+        return null;
114 114
     }
115 115
 
116 116
 
@@ -119,8 +119,8 @@ public class PrimativeTypes {
119 119
      * @param divisor value to divide by
120 120
      * @return division of `dividend` by `divisor
121 121
      */
122
-    public int divide(int dividend, int divisor) {
123
-        return 0;
122
+    public Integer divide(int dividend, int divisor) {
123
+        return null;
124 124
     }
125 125
 
126 126
     /**
@@ -128,8 +128,8 @@ public class PrimativeTypes {
128 128
      * @param divisor value to divide by
129 129
      * @return division of `dividend` by `divisor
130 130
      */
131
-    public long divide(long dividend, long divisor) {
132
-        return 0;
131
+    public Long divide(long dividend, long divisor) {
132
+        return null;
133 133
     }
134 134
 
135 135
     /**
@@ -137,8 +137,8 @@ public class PrimativeTypes {
137 137
      * @param divisor value to divide by
138 138
      * @return division of `dividend` by `divisor
139 139
      */
140
-    public short divide(short dividend, short divisor) {
141
-        return 0;
140
+    public Short divide(short dividend, short divisor) {
141
+        return null;
142 142
     }
143 143
 
144 144
     /**
@@ -146,8 +146,8 @@ public class PrimativeTypes {
146 146
      * @param divisor value to divide by
147 147
      * @return division of `dividend` by `divisor
148 148
      */
149
-    public byte divide(byte dividend, byte divisor) {
150
-        return 0;
149
+    public Byte divide(byte dividend, byte divisor) {
150
+        return null;
151 151
     }
152 152
 
153 153
     /**
@@ -155,8 +155,8 @@ public class PrimativeTypes {
155 155
      * @param divisor value to divide by
156 156
      * @return division of `dividend` by `divisor
157 157
      */
158
-    public float divide(float dividend, float divisor) {
159
-        return 0;
158
+    public Float divide(float dividend, float divisor) {
159
+        return null;
160 160
     }
161 161
 
162 162
     /**
@@ -164,8 +164,8 @@ public class PrimativeTypes {
164 164
      * @param divisor value to divide by
165 165
      * @return division of `dividend` by `divisor
166 166
      */
167
-    public double divide(double dividend, double divisor) {
168
-        return 0;
167
+    public Double divide(double dividend, double divisor) {
168
+        return null;
169 169
     }
170 170
 
171 171
 
@@ -174,8 +174,8 @@ public class PrimativeTypes {
174 174
      * @param multiplier value to multiply by
175 175
      * @return product of `multiplicand` by `multiplier`
176 176
      */
177
-    public int multiply(int multiplicand, int multiplier) {
178
-        return 0;
177
+    public Integer multiply(int multiplicand, int multiplier) {
178
+        return null;
179 179
     }
180 180
 
181 181
     /**
@@ -183,8 +183,8 @@ public class PrimativeTypes {
183 183
      * @param multiplier value to multiply by
184 184
      * @return product of `multiplicand` by `multiplier`
185 185
      */
186
-    public long multiply(long multiplicand, long multiplier) {
187
-        return 0;
186
+    public Long multiply(long multiplicand, long multiplier) {
187
+        return null;
188 188
     }
189 189
 
190 190
     /**
@@ -192,16 +192,16 @@ public class PrimativeTypes {
192 192
      * @param multiplier value to multiply by
193 193
      * @return product of `multiplicand` by `multiplier`
194 194
      */
195
-    public short multiply(short multiplicand, short multiplier) {
196
-        return 0;
195
+    public Short multiply(short multiplicand, short multiplier) {
196
+        return null;
197 197
     }
198 198
     /**
199 199
      * @param multiplicand value to be multiplied
200 200
      * @param multiplier value to multiply by
201 201
      * @return product of `multiplicand` by `multiplier`
202 202
      */
203
-    public byte multiply(byte multiplicand, byte multiplier) {
204
-        return 0;
203
+    public Byte multiply(byte multiplicand, byte multiplier) {
204
+        return null;
205 205
     }
206 206
 
207 207
     /**
@@ -209,8 +209,8 @@ public class PrimativeTypes {
209 209
      * @param multiplier value to multiply by
210 210
      * @return product of `multiplicand` by `multiplier`
211 211
      */
212
-    public float multiply(float multiplicand, float multiplier) {
213
-        return 0;
212
+    public Float multiply(float multiplicand, float multiplier) {
213
+        return null;
214 214
     }
215 215
 
216 216
     /**
@@ -218,23 +218,23 @@ public class PrimativeTypes {
218 218
      * @param multiplier value to multiply by
219 219
      * @return product of `multiplicand` by `multiplier`
220 220
      */
221
-    public double multiply(double multiplicand, double multiplier) {
222
-        return 0;
221
+    public Double multiply(double multiplicand, double multiplier) {
222
+        return null;
223 223
     }
224 224
 
225 225
 
226 226
     /**
227 227
       * @return true
228 228
      */
229
-    public boolean returnTrue() {
230
-        return false;
229
+    public Boolean returnTrue() {
230
+        return null;
231 231
     }
232 232
 
233 233
     /**
234 234
      * @return false
235 235
      */
236
-    public boolean returnFalse() {
237
-        return true;
236
+    public Boolean returnFalse() {
237
+        return null;
238 238
     }
239 239
 
240 240
 }

+ 82
- 0
src/main/java/com/zipcodewilmington/danny_do_better_exercises/StringUtilities.java View File

@@ -0,0 +1,82 @@
1
+package com.zipcodewilmington.danny_do_better_exercises;
2
+
3
+/**
4
+ * Created by dan on 6/14/17.
5
+ */
6
+public class StringUtilities {
7
+
8
+    /**
9
+     * @param firstSegment a string to be added to
10
+     * @param secondSegment a string to add
11
+     * @return the concatenation of two strings, `firstSegment`, and `secondSegment`
12
+     */
13
+    public static String concatenation(String firstSegment, String secondSegment){
14
+        return null;
15
+    }
16
+
17
+    /**
18
+     * @param firstSegment a string to be added to
19
+     * @param secondSegment a string to add
20
+     * @return the concatenation of an integer, `firstSegment`, and a String, `secondSegment`
21
+     */
22
+    public static String concatenation(int firstSegment, String secondSegment){
23
+        return null;
24
+    }
25
+
26
+    /**
27
+     * @param input a string to be manipulated
28
+     * @return the first 3 characters of `input`
29
+     */
30
+    public static String getPrefix(String input){
31
+        return null;
32
+    }
33
+
34
+    /**
35
+     * @param input a string to be manipulated
36
+     * @return the last 3 characters of `input`
37
+     */
38
+    public static String getSuffix(String input){
39
+        return null;
40
+    }
41
+
42
+    /**
43
+     * @param inputValue the value to be compared
44
+     * @param comparableValue the value to be compared against
45
+     * @return the equivalence of two strings, `inputValue` and `comparableValue`
46
+     */
47
+    public static Boolean compareTwoStrings(String inputValue, String comparableValue){
48
+        return null;
49
+    }
50
+
51
+    /**
52
+     * @param inputValue the value input from user
53
+     * @return the middle character of `inputValue`
54
+     */
55
+    public static Character getMiddleCharacter(String inputValue){
56
+        return null;
57
+    }
58
+
59
+    /**
60
+     * @param spaceDelimitedString a string, representative of a sentence, containing spaces
61
+     * @return the first sequence of characters
62
+     */
63
+    public static String getFirstWord(String spaceDelimitedString){
64
+        return null;
65
+    }
66
+
67
+    /**
68
+     * @param spaceDelimitedString a string delimited by spaces
69
+     * @return the second word of a string delimited by spaces.
70
+     */
71
+    public static String getSecondWord(String spaceDelimitedString){
72
+        return null;
73
+    }
74
+
75
+    /**
76
+     * @param stringToReverse
77
+     * @return an identical string with characters in reverse order.
78
+     */
79
+    public static String reverseTheTwo(String stringToReverse){
80
+        return null;
81
+    }
82
+}

src/test/java/com/zipcodewilmington/danny_do_better/HelloWorldTest.java → src/test/java/com/zipcodewilmington/danny_do_better_exercises/HelloWorldTest.java View File

@@ -1,4 +1,4 @@
1
-package com.zipcodewilmington.danny_do_better;
1
+package com.zipcodewilmington.danny_do_better_exercises;
2 2
 
3 3
 import org.junit.Test;
4 4
 

src/test/java/com/zipcodewilmington/danny_do_better/MathUtilitiesTest.java → src/test/java/com/zipcodewilmington/danny_do_better_exercises/PredicateUtilitiesTest.java View File

@@ -1,42 +1,12 @@
1
-package com.zipcodewilmington.danny_do_better;
1
+package com.zipcodewilmington.danny_do_better_exercises;
2 2
 
3
-import org.junit.Before;
4 3
 import org.junit.Test;
5 4
 import static org.junit.Assert.*;
6 5
 /**
7 6
  * Created by dan on 6/14/17.
8 7
  */
9
-public class MathUtilitiesTest {
10
-    private static volatile MathUtilities math = new MathUtilities();
11
-
12
-    @Test
13
-    public void testRemainder1(){
14
-        // : Given
15
-        Integer dividend = 7;
16
-        Integer divisor = 3;
17
-        Integer expected = 1;
18
-
19
-        // : When
20
-        Integer actual = math.remainder(dividend, divisor);
21
-
22
-        // : Then
23
-        assertEquals(expected, actual);
24
-    }
25
-
26
-
27
-    @Test
28
-    public void testRemainder2(){
29
-        // : Given
30
-        Integer dividend = 8;
31
-        Integer divisor = 3;
32
-        Integer expected = 2;
33
-
34
-        // : When
35
-        Integer actual = math.remainder(dividend, divisor);
36
-
37
-        // : Then
38
-        assertEquals(expected, actual);
39
-    }
8
+public class PredicateUtilitiesTest {
9
+    private static volatile PredicateUtilities math = new PredicateUtilities();
40 10
 
41 11
     @Test
42 12
     public void testGreaterThanTrue(){
@@ -73,7 +43,6 @@ public class MathUtilitiesTest {
73 43
         int greaterValue = 450;
74 44
         int lesserValue = 350;
75 45
 
76
-
77 46
         // : When
78 47
         boolean outcome = math.isLessThan(greaterValue, lesserValue);
79 48
 
@@ -89,7 +58,6 @@ public class MathUtilitiesTest {
89 58
         int greaterValue = 450;
90 59
         int lesserValue = 350;
91 60
 
92
-
93 61
         // : When
94 62
         boolean outcome = math.isLessThan(greaterValue, lesserValue);
95 63
 
@@ -99,29 +67,55 @@ public class MathUtilitiesTest {
99 67
 
100 68
 
101 69
     @Test
102
-    public void testLessOrEqual(){
103
-        assertTrue(math.isLessThanOrEqualTo(3 , 3));
104
-        assertTrue(math.isLessThanOrEqualTo(3, 6));
70
+    public void testLessOrEqual1(){
71
+        // : Given
72
+        int greaterValue = 3;
73
+        int lesserValue = 3;
74
+
75
+        // : When
76
+        boolean outcome = math.isLessThanOrEqualTo(greaterValue, lesserValue);
77
+
78
+        // : Then
79
+        assertTrue(outcome);
105 80
     }
106 81
 
107 82
     @Test
108
-    public void testGreaterOrEqual(){
109
-        assertTrue(math.isGreaterThanOrEqualTo(4, 4));
110
-        assertTrue(math.isGreaterThanOrEqualTo(78, 5));
83
+    public void testLessOrEqual2(){
84
+        // : Given
85
+        int greaterValue = 3;
86
+        int lesserValue = 6;
87
+
88
+        // : When
89
+        boolean outcome = math.isLessThanOrEqualTo(greaterValue, lesserValue);
90
+
91
+        // : Then
92
+        assertTrue(outcome);
111 93
     }
112 94
 
113 95
     @Test
114
-    public void testLogicalAnd(){
115
-        assertTrue(math.isBoth(3));
116
-        assertFalse(math.isBoth(4));
96
+    public void testGreaterOrEqual1(){
97
+        // : Given
98
+        int greaterValue = 4;
99
+        int lesserValue = 4;
100
+
101
+        // : When
102
+        boolean outcome = math.isGreaterThanOrEqualTo(greaterValue, lesserValue);
103
+
104
+        // : ThenP
105
+        assertTrue(outcome);
117 106
     }
118 107
 
108
+
119 109
     @Test
120
-    public void testLogicalOr(){
121
-        assertTrue(math.logicalOr(4));
122
-        assertTrue(math.logicalOr(14564));
123
-        assertFalse(math.logicalOr(54));
124
-    }
110
+    public void testGreaterOrEqual2(){
111
+        // : Given
112
+        int greaterValue = 8;
113
+        int lesserValue = 15;
125 114
 
115
+        // : When
116
+        boolean outcome = math.isGreaterThanOrEqualTo(greaterValue, lesserValue);
126 117
 
118
+        // : Then
119
+        assertTrue(outcome);
120
+    }
127 121
 }

src/test/java/com/zipcodewilmington/danny_do_better/PrimativeTypesTest.java → src/test/java/com/zipcodewilmington/danny_do_better_exercises/PrimativeTypesTest.java View File

@@ -1,4 +1,4 @@
1
-package com.zipcodewilmington.danny_do_better;
1
+package com.zipcodewilmington.danny_do_better_exercises;
2 2
 
3 3
 import org.junit.Test;
4 4
 
@@ -7,7 +7,7 @@ import static org.junit.Assert.*;
7 7
  * Created by dan on 6/14/17.
8 8
  */
9 9
 public class PrimativeTypesTest {
10
-    private PrimativeTypes primativeTypes = new PrimativeTypes();
10
+    private static volatile PrimitiveTypes primativeTypes = new PrimitiveTypes();
11 11
 
12 12
     @Test
13 13
     public void testAdditions() {

src/test/java/com/zipcodewilmington/danny_do_better/StringUtilitiesTest.java → src/test/java/com/zipcodewilmington/danny_do_better_exercises/StringUtilitiesTest.java View File

@@ -1,7 +1,6 @@
1
-package com.zipcodewilmington.danny_do_better;
1
+package com.zipcodewilmington.danny_do_better_exercises;
2 2
 
3 3
 import org.junit.Assert;
4
-import org.junit.Before;
5 4
 import org.junit.Test;
6 5
 import static org.junit.Assert.*;
7 6
 
@@ -9,7 +8,6 @@ import static org.junit.Assert.*;
9 8
  * Created by dan on 6/14/17.
10 9
  */
11 10
 public class StringUtilitiesTest {
12
-    private static StringUtilities stringUtilities = new StringUtilities();
13 11
 
14 12
     @Test
15 13
     public void concatenationStringTest(){
@@ -19,7 +17,7 @@ public class StringUtilitiesTest {
19 17
         String expected = "Hello Java";
20 18
 
21 19
         // : When
22
-        String actual = stringUtilities.concatenation(one,two);
20
+        String actual = StringUtilities.concatenation(one,two);
23 21
 
24 22
 
25 23
         // : Then
@@ -35,7 +33,7 @@ public class StringUtilitiesTest {
35 33
         String expected = "1 Java";
36 34
 
37 35
         // : When
38
-        String actual = stringUtilities.concatenation(one,two);
36
+        String actual = StringUtilities.concatenation(one,two);
39 37
 
40 38
 
41 39
         // : Then
@@ -49,7 +47,7 @@ public class StringUtilitiesTest {
49 47
         String expected = "olleH";
50 48
 
51 49
         // : When
52
-        String actual = stringUtilities.getPrefix(input);
50
+        String actual = StringUtilities.getPrefix(input);
53 51
 
54 52
         // : Then
55 53
         assertEquals(expected, actual);
@@ -62,7 +60,7 @@ public class StringUtilitiesTest {
62 60
         String expected = "llo";
63 61
 
64 62
         // : When
65
-        String actual = stringUtilities.getSuffix("Hello");
63
+        String actual = StringUtilities.getSuffix("Hello");
66 64
 
67 65
         // : Then
68 66
         assertEquals(expected, actual);
@@ -75,7 +73,7 @@ public class StringUtilitiesTest {
75 73
         String comparableValue = "Zipcode";
76 74
 
77 75
         // : When
78
-        boolean actual = stringUtilities.compareTwoStrings(inputValue, comparableValue);
76
+        boolean actual = StringUtilities.compareTwoStrings(inputValue, comparableValue);
79 77
 
80 78
         // : Then
81 79
         assertTrue(actual);
@@ -89,20 +87,20 @@ public class StringUtilitiesTest {
89 87
         String comparableValue = "Zipcodee";
90 88
 
91 89
         // : When
92
-        boolean actual = stringUtilities.compareTwoStrings(inputValue, comparableValue);
90
+        boolean actual = StringUtilities.compareTwoStrings(inputValue, comparableValue);
93 91
 
94 92
         // : Then
95 93
         assertFalse(actual);
96 94
     }
97 95
 
98 96
     @Test
99
-    public void getTheMiddleChar(){
97
+    public void getTheMiddleChar1(){
100 98
         // : Given
101 99
         String input = "Zipcode";
102 100
         char expected = 'c';
103 101
 
104 102
         // : When
105
-        char actual = stringUtilities.getMiddleCharacter(input);
103
+        char actual = StringUtilities.getMiddleCharacter(input);
106 104
 
107 105
         // : Then
108 106
         Assert.assertEquals(expected, actual);
@@ -110,13 +108,13 @@ public class StringUtilitiesTest {
110 108
 
111 109
 
112 110
     @Test
113
-    public void getTheMiddleCharr(){
111
+    public void getTheMiddleChar2(){
114 112
         // : Given
115 113
         String input = "Zipcoder";
116 114
         Character expected = 'c';
117 115
 
118 116
         // : When
119
-        Character actual = stringUtilities.getMiddleCharacter(input);
117
+        Character actual = StringUtilities.getMiddleCharacter(input);
120 118
 
121 119
         // : Then
122 120
         Assert.assertEquals(expected.toString(), actual.toString());
@@ -130,7 +128,7 @@ public class StringUtilitiesTest {
130 128
         String expected = "Zipcode";
131 129
 
132 130
         // : When
133
-        String actual = stringUtilities.getFirstWord(input);
131
+        String actual = StringUtilities.getFirstWord(input);
134 132
 
135 133
         // : Then
136 134
         assertEquals(expected, actual);
@@ -144,7 +142,7 @@ public class StringUtilitiesTest {
144 142
         String expected = "Wilmington";
145 143
 
146 144
         // : When
147
-        String actual = stringUtilities.getFirstWord(input);
145
+        String actual = StringUtilities.getFirstWord(input);
148 146
 
149 147
         // : Then
150 148
         assertEquals(expected, actual);
@@ -158,7 +156,7 @@ public class StringUtilitiesTest {
158 156
 
159 157
 
160 158
         // : When
161
-        String actual = stringUtilities.reverseTheTwo(input);
159
+        String actual = StringUtilities.reverseTheTwo(input);
162 160
 
163 161
         // : Then
164 162
         assertEquals(expected, actual);

+ 18
- 0
src/test/java/com/zipcodewilmington/danny_do_better_exercises/TestSuite.java View File

@@ -0,0 +1,18 @@
1
+package com.zipcodewilmington.danny_do_better_exercises;
2
+
3
+import org.junit.runner.RunWith;
4
+import org.junit.runners.Suite;
5
+
6
+/**
7
+ * Created by leon on 2/5/18.
8
+ */
9
+@RunWith(Suite.class)
10
+
11
+@Suite.SuiteClasses({
12
+        HelloWorldTest.class,
13
+        PredicateUtilitiesTest.class,
14
+        PrimativeTypesTest.class,
15
+        StringUtilitiesTest.class,
16
+})
17
+public class TestSuite {
18
+}

BIN
target/classes/com/zipcodewilmington/danny_do_better/MathUtilities.class View File


BIN
target/classes/com/zipcodewilmington/danny_do_better/PredicateUtilities.class View File


BIN
target/classes/com/zipcodewilmington/danny_do_better/PrimativeTypes.class View File


BIN
target/classes/com/zipcodewilmington/danny_do_better/PrimitiveTypes.class View File


BIN
target/classes/com/zipcodewilmington/danny_do_better/StringUtilities.class View File


BIN
target/test-classes/com/zipcodewilmington/danny_do_better/HelloWorldTest.class View File


BIN
target/test-classes/com/zipcodewilmington/danny_do_better/MathUtilitiesTest.class View File


BIN
target/test-classes/com/zipcodewilmington/danny_do_better/PredicateUtilitiesTest.class View File


BIN
target/test-classes/com/zipcodewilmington/danny_do_better/PrimativeTypesTest.class View File


BIN
target/test-classes/com/zipcodewilmington/danny_do_better/StringUtilitiesTest.class View File


BIN
target/test-classes/com/zipcodewilmington/danny_do_better/TestSuite.class View File