浏览代码

Dan the man

Joe Hendricks 6 年前
父节点
当前提交
327755d1fe
共有 17 个文件被更改,包括 131 次插入136 次删除
  1. 1
    1
      .idea/compiler.xml
  2. 0
    7
      .idea/kotlinc.xml
  3. 0
    77
      .idea/misc.xml
  4. 59
    27
      src/main/java/com/zipcodewilmington/danny_do_better_exercises/MathUtilities.java
  5. 13
    5
      src/main/java/com/zipcodewilmington/danny_do_better_exercises/PredicateUtilities.java
  6. 49
    10
      src/main/java/com/zipcodewilmington/danny_do_better_exercises/StringUtilities.java
  7. 1
    1
      src/main/java/com/zipcodewilmington/danny_do_better_exercises/ZipcodeRocks.java
  8. 3
    3
      src/test/java/com/zipcodewilmington/danny_do_better_exercises/TestMathUtilities.java
  9. 3
    3
      src/test/java/com/zipcodewilmington/danny_do_better_exercises/TestPredicateUtilities.java
  10. 2
    2
      src/test/java/com/zipcodewilmington/danny_do_better_exercises/TestStringUtilities.java
  11. 二进制
      target/classes/com/zipcodewilmington/danny_do_better_exercises/MathUtilities.class
  12. 二进制
      target/classes/com/zipcodewilmington/danny_do_better_exercises/PredicateUtilities.class
  13. 二进制
      target/classes/com/zipcodewilmington/danny_do_better_exercises/StringUtilities.class
  14. 二进制
      target/classes/com/zipcodewilmington/danny_do_better_exercises/ZipcodeRocks.class
  15. 二进制
      target/test-classes/com/zipcodewilmington/danny_do_better_exercises/TestMathUtilities.class
  16. 二进制
      target/test-classes/com/zipcodewilmington/danny_do_better_exercises/TestPredicateUtilities.class
  17. 二进制
      target/test-classes/com/zipcodewilmington/danny_do_better_exercises/TestStringUtilities.class

+ 1
- 1
.idea/compiler.xml 查看文件

9
         <module name="ChapterOneMicro" />
9
         <module name="ChapterOneMicro" />
10
       </profile>
10
       </profile>
11
     </annotationProcessing>
11
     </annotationProcessing>
12
-    <bytecodeTargetLevel target="1.8">
12
+    <bytecodeTargetLevel>
13
       <module name="ChapterOneMicro" target="1.8" />
13
       <module name="ChapterOneMicro" target="1.8" />
14
     </bytecodeTargetLevel>
14
     </bytecodeTargetLevel>
15
   </component>
15
   </component>

+ 0
- 7
.idea/kotlinc.xml 查看文件

1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="KotlinCommonCompilerArguments">
4
-    <option name="languageVersion" value="1.1" />
5
-    <option name="apiVersion" value="1.1" />
6
-  </component>
7
-</project>

+ 0
- 77
.idea/misc.xml 查看文件

7
       </list>
7
       </list>
8
     </option>
8
     </option>
9
   </component>
9
   </component>
10
-  <component name="ProjectInspectionProfilesVisibleTreeState">
11
-    <entry key="Project Default">
12
-      <profile-state>
13
-        <expanded-state>
14
-          <State>
15
-            <id />
16
-          </State>
17
-        </expanded-state>
18
-        <selected-state>
19
-          <State>
20
-            <id>Android</id>
21
-          </State>
22
-        </selected-state>
23
-      </profile-state>
24
-    </entry>
25
-  </component>
26
   <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
10
   <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
27
     <output url="file://$PROJECT_DIR$/classes" />
11
     <output url="file://$PROJECT_DIR$/classes" />
28
   </component>
12
   </component>
29
-  <component name="masterDetails">
30
-    <states>
31
-      <state key="GlobalLibrariesConfigurable.UI">
32
-        <settings>
33
-          <splitter-proportions>
34
-            <option name="proportions">
35
-              <list>
36
-                <option value="0.2" />
37
-              </list>
38
-            </option>
39
-          </splitter-proportions>
40
-        </settings>
41
-      </state>
42
-      <state key="JdkListConfigurable.UI">
43
-        <settings>
44
-          <last-edited>1.8</last-edited>
45
-          <splitter-proportions>
46
-            <option name="proportions">
47
-              <list>
48
-                <option value="0.2" />
49
-              </list>
50
-            </option>
51
-          </splitter-proportions>
52
-        </settings>
53
-      </state>
54
-      <state key="ProjectJDKs.UI">
55
-        <settings>
56
-          <last-edited>1.8</last-edited>
57
-          <splitter-proportions>
58
-            <option name="proportions">
59
-              <list>
60
-                <option value="0.2" />
61
-              </list>
62
-            </option>
63
-          </splitter-proportions>
64
-        </settings>
65
-      </state>
66
-      <state key="ProjectLibrariesConfigurable.UI">
67
-        <settings>
68
-          <splitter-proportions>
69
-            <option name="proportions">
70
-              <list>
71
-                <option value="0.2" />
72
-              </list>
73
-            </option>
74
-          </splitter-proportions>
75
-        </settings>
76
-      </state>
77
-      <state key="ScopeChooserConfigurable.UI">
78
-        <settings>
79
-          <splitter-proportions>
80
-            <option name="proportions">
81
-              <list>
82
-                <option value="0.2" />
83
-              </list>
84
-            </option>
85
-          </splitter-proportions>
86
-        </settings>
87
-      </state>
88
-    </states>
89
-  </component>
90
 </project>
13
 </project>

+ 59
- 27
src/main/java/com/zipcodewilmington/danny_do_better_exercises/MathUtilities.java 查看文件

11
      * @return sum of `baseValue` and `difference`
11
      * @return sum of `baseValue` and `difference`
12
      */
12
      */
13
     public Integer add(int baseValue, int difference) {
13
     public Integer add(int baseValue, int difference) {
14
-        return null;
14
+
15
+        return baseValue + difference;
16
+
15
     }
17
     }
16
 
18
 
17
     /**
19
     /**
19
      * @param difference value to add to starting value
21
      * @param difference value to add to starting value
20
      * @return sum of `baseValue` and `difference`
22
      * @return sum of `baseValue` and `difference`
21
      */
23
      */
24
+
25
+
26
+
22
     public Long add(long baseValue, long difference) {
27
     public Long add(long baseValue, long difference) {
23
-        return null;
28
+
29
+        return baseValue + difference;
30
+
24
     }
31
     }
25
 
32
 
26
     /**
33
     /**
29
      * @return sum of `baseValue` and `difference`
36
      * @return sum of `baseValue` and `difference`
30
      */
37
      */
31
     public Short add(short baseValue, short difference) {
38
     public Short add(short baseValue, short difference) {
32
-        return null;
39
+
40
+        return (short)(baseValue + difference);
33
     }
41
     }
34
 
42
 
35
     /**
43
     /**
38
      * @return sum of `baseValue` and `difference`
46
      * @return sum of `baseValue` and `difference`
39
      */
47
      */
40
     public Byte add(byte baseValue, byte difference) {
48
     public Byte add(byte baseValue, byte difference) {
41
-        return null;
49
+
50
+        return (byte)(baseValue + difference);
42
     }
51
     }
43
 
52
 
44
     /**
53
     /**
47
      * @return sum of `baseValue` and `difference`
56
      * @return sum of `baseValue` and `difference`
48
      */
57
      */
49
     public Float add(float baseValue, float difference) {
58
     public Float add(float baseValue, float difference) {
50
-        return null;
59
+
60
+        return baseValue + difference;
51
     }
61
     }
52
 
62
 
53
     /**
63
     /**
56
      * @return sum of `baseValue` and `difference`
66
      * @return sum of `baseValue` and `difference`
57
      */
67
      */
58
     public Double add(double baseValue, double difference) {
68
     public Double add(double baseValue, double difference) {
59
-        return null;
69
+
70
+        return baseValue + difference;
60
     }
71
     }
61
 
72
 
62
     /**
73
     /**
65
      * @return difference between `baseValue` and `difference`
76
      * @return difference between `baseValue` and `difference`
66
      */
77
      */
67
     public Integer subtract(int baseValue, int difference) {
78
     public Integer subtract(int baseValue, int difference) {
68
-        return null;
79
+
80
+        return baseValue - difference;
69
     }
81
     }
70
 
82
 
71
     /**
83
     /**
74
      * @return difference between `baseValue` and `difference`
86
      * @return difference between `baseValue` and `difference`
75
      */
87
      */
76
     public Long subtract(long baseValue, long difference) {
88
     public Long subtract(long baseValue, long difference) {
77
-        return null;
89
+
90
+        return baseValue - difference;
78
     }
91
     }
79
 
92
 
80
     /**
93
     /**
83
      * @return difference between `baseValue` and `difference`
96
      * @return difference between `baseValue` and `difference`
84
      */
97
      */
85
     public Short subtract(short baseValue, short difference) {
98
     public Short subtract(short baseValue, short difference) {
86
-        return null;
99
+
100
+        return (short)(baseValue - difference);
87
     }
101
     }
88
 
102
 
89
     /**
103
     /**
92
      * @return difference between `baseValue` and `difference`
106
      * @return difference between `baseValue` and `difference`
93
      */
107
      */
94
     public Byte subtract(byte baseValue, byte difference) {
108
     public Byte subtract(byte baseValue, byte difference) {
95
-        return null;
109
+
110
+        return (byte)(baseValue - difference);
96
     }
111
     }
97
 
112
 
98
     /**
113
     /**
101
      * @return difference between `baseValue` and `difference`
116
      * @return difference between `baseValue` and `difference`
102
      */
117
      */
103
     public Float subtract(float baseValue, float difference) {
118
     public Float subtract(float baseValue, float difference) {
104
-        return null;
119
+
120
+        return baseValue - difference;
105
     }
121
     }
106
 
122
 
107
     /**
123
     /**
110
      * @return difference between `baseValue` and `difference`
126
      * @return difference between `baseValue` and `difference`
111
      */
127
      */
112
     public Double subtract(double baseValue, double difference) {
128
     public Double subtract(double baseValue, double difference) {
113
-        return null;
129
+
130
+        return baseValue - difference;
114
     }
131
     }
115
 
132
 
116
 
133
 
120
      * @return division of `dividend` by `divisor
137
      * @return division of `dividend` by `divisor
121
      */
138
      */
122
     public Integer divide(int dividend, int divisor) {
139
     public Integer divide(int dividend, int divisor) {
123
-        return null;
140
+
141
+        return dividend / divisor;
124
     }
142
     }
125
 
143
 
126
     /**
144
     /**
129
      * @return division of `dividend` by `divisor
147
      * @return division of `dividend` by `divisor
130
      */
148
      */
131
     public Long divide(long dividend, long divisor) {
149
     public Long divide(long dividend, long divisor) {
132
-        return null;
150
+
151
+        return dividend / divisor;
133
     }
152
     }
134
 
153
 
135
     /**
154
     /**
138
      * @return division of `dividend` by `divisor
157
      * @return division of `dividend` by `divisor
139
      */
158
      */
140
     public Short divide(short dividend, short divisor) {
159
     public Short divide(short dividend, short divisor) {
141
-        return null;
160
+
161
+        return (short)(dividend / divisor);
142
     }
162
     }
143
 
163
 
144
     /**
164
     /**
147
      * @return division of `dividend` by `divisor
167
      * @return division of `dividend` by `divisor
148
      */
168
      */
149
     public Byte divide(byte dividend, byte divisor) {
169
     public Byte divide(byte dividend, byte divisor) {
150
-        return null;
170
+
171
+        return (byte)(dividend / divisor);
151
     }
172
     }
152
 
173
 
153
     /**
174
     /**
156
      * @return division of `dividend` by `divisor
177
      * @return division of `dividend` by `divisor
157
      */
178
      */
158
     public Float divide(float dividend, float divisor) {
179
     public Float divide(float dividend, float divisor) {
159
-        return null;
180
+
181
+        return dividend / divisor;
160
     }
182
     }
161
 
183
 
162
     /**
184
     /**
165
      * @return division of `dividend` by `divisor
187
      * @return division of `dividend` by `divisor
166
      */
188
      */
167
     public Double divide(double dividend, double divisor) {
189
     public Double divide(double dividend, double divisor) {
168
-        return null;
190
+
191
+        return dividend / divisor;
192
+
169
     }
193
     }
170
 
194
 
171
 
195
 
175
      * @return product of `multiplicand` by `multiplier`
199
      * @return product of `multiplicand` by `multiplier`
176
      */
200
      */
177
     public Integer multiply(int multiplicand, int multiplier) {
201
     public Integer multiply(int multiplicand, int multiplier) {
178
-        return null;
202
+
203
+        return multiplicand * multiplier;
179
     }
204
     }
180
 
205
 
181
     /**
206
     /**
184
      * @return product of `multiplicand` by `multiplier`
209
      * @return product of `multiplicand` by `multiplier`
185
      */
210
      */
186
     public Long multiply(long multiplicand, long multiplier) {
211
     public Long multiply(long multiplicand, long multiplier) {
187
-        return null;
212
+
213
+        return multiplicand * multiplier;
188
     }
214
     }
189
 
215
 
190
     /**
216
     /**
193
      * @return product of `multiplicand` by `multiplier`
219
      * @return product of `multiplicand` by `multiplier`
194
      */
220
      */
195
     public Short multiply(short multiplicand, short multiplier) {
221
     public Short multiply(short multiplicand, short multiplier) {
196
-        return null;
222
+
223
+        return (short)(multiplicand * multiplier);
197
     }
224
     }
198
     /**
225
     /**
199
      * @param multiplicand value to be multiplied
226
      * @param multiplicand value to be multiplied
201
      * @return product of `multiplicand` by `multiplier`
228
      * @return product of `multiplicand` by `multiplier`
202
      */
229
      */
203
     public Byte multiply(byte multiplicand, byte multiplier) {
230
     public Byte multiply(byte multiplicand, byte multiplier) {
204
-        return null;
205
-    }
231
+
232
+        return (byte)(multiplicand * multiplier);
233
+            }
206
 
234
 
207
     /**
235
     /**
208
      * @param multiplicand value to be multiplied
236
      * @param multiplicand value to be multiplied
210
      * @return product of `multiplicand` by `multiplier`
238
      * @return product of `multiplicand` by `multiplier`
211
      */
239
      */
212
     public Float multiply(float multiplicand, float multiplier) {
240
     public Float multiply(float multiplicand, float multiplier) {
213
-        return null;
241
+
242
+        return multiplicand * multiplier;
214
     }
243
     }
215
 
244
 
216
     /**
245
     /**
219
      * @return product of `multiplicand` by `multiplier`
248
      * @return product of `multiplicand` by `multiplier`
220
      */
249
      */
221
     public Double multiply(double multiplicand, double multiplier) {
250
     public Double multiply(double multiplicand, double multiplier) {
222
-        return null;
251
+
252
+        return multiplicand * multiplier;
223
     }
253
     }
224
 
254
 
225
 
255
 
227
       * @return true
257
       * @return true
228
      */
258
      */
229
     public Boolean returnTrue() {
259
     public Boolean returnTrue() {
230
-        return null;
260
+
261
+        return true;
231
     }
262
     }
232
 
263
 
233
     /**
264
     /**
234
      * @return false
265
      * @return false
235
      */
266
      */
236
     public Boolean returnFalse() {
267
     public Boolean returnFalse() {
237
-        return null;
268
+
269
+        return false;
238
     }
270
     }
239
 
271
 
240
 }
272
 }

+ 13
- 5
src/main/java/com/zipcodewilmington/danny_do_better_exercises/PredicateUtilities.java 查看文件

10
      * @return true if `x` is greater than `y`
10
      * @return true if `x` is greater than `y`
11
      */
11
      */
12
     public Boolean isGreaterThan(int x, int y) {
12
     public Boolean isGreaterThan(int x, int y) {
13
-        return null;
14
-    }
13
+
14
+        return x > y;
15
+
16
+        }
15
 
17
 
16
     /**
18
     /**
17
      * @param x
19
      * @param x
19
      * @return true if `x` is less than `y`
21
      * @return true if `x` is less than `y`
20
      */
22
      */
21
     public Boolean isLessThan(int x, int y) {
23
     public Boolean isLessThan(int x, int y) {
22
-        return null;
24
+
25
+        return x < y;
26
+
23
     }
27
     }
24
 
28
 
25
     /**
29
     /**
28
      * @return true if `x` is greater than or equal to `y`
32
      * @return true if `x` is greater than or equal to `y`
29
      */
33
      */
30
     public Boolean isGreaterThanOrEqualTo(int x, int y) {
34
     public Boolean isGreaterThanOrEqualTo(int x, int y) {
31
-        return null;
35
+
36
+        return x >= y;
37
+
32
     }
38
     }
33
 
39
 
34
     /**
40
     /**
37
      * @return true if `x` is less than or equal to `y`
43
      * @return true if `x` is less than or equal to `y`
38
      */
44
      */
39
     public Boolean isLessThanOrEqualTo(int x, int y) {
45
     public Boolean isLessThanOrEqualTo(int x, int y) {
40
-        return null;
46
+
47
+        return x <= y;
48
+
41
     }
49
     }
42
 }
50
 }

+ 49
- 10
src/main/java/com/zipcodewilmington/danny_do_better_exercises/StringUtilities.java 查看文件

8
      * @return `Hello World` as a string
8
      * @return `Hello World` as a string
9
      */
9
      */
10
     public static String getHelloWorld() {
10
     public static String getHelloWorld() {
11
-        return null;
11
+
12
+        return "Hello World";
12
     }
13
     }
13
 
14
 
14
     /**
15
     /**
17
      * @return the concatenation of two strings, `firstSegment`, and `secondSegment`
18
      * @return the concatenation of two strings, `firstSegment`, and `secondSegment`
18
      */
19
      */
19
     public static String concatenation(String firstSegment, String secondSegment){
20
     public static String concatenation(String firstSegment, String secondSegment){
20
-        return null;
21
+
22
+        return firstSegment + secondSegment;
21
     }
23
     }
22
 
24
 
23
     /**
25
     /**
26
      * @return the concatenation of an integer, `firstSegment`, and a String, `secondSegment`
28
      * @return the concatenation of an integer, `firstSegment`, and a String, `secondSegment`
27
      */
29
      */
28
     public static String concatenation(int firstSegment, String secondSegment){
30
     public static String concatenation(int firstSegment, String secondSegment){
29
-        return null;
31
+
32
+        return firstSegment + secondSegment;
30
     }
33
     }
31
 
34
 
32
     /**
35
     /**
34
      * @return the first 3 characters of `input`
37
      * @return the first 3 characters of `input`
35
      */
38
      */
36
     public static String getPrefix(String input){
39
     public static String getPrefix(String input){
37
-        return null;
40
+
41
+        return input.substring(0,3);
38
     }
42
     }
39
 
43
 
40
     /**
44
     /**
42
      * @return the last 3 characters of `input`
46
      * @return the last 3 characters of `input`
43
      */
47
      */
44
     public static String getSuffix(String input){
48
     public static String getSuffix(String input){
45
-        return null;
49
+
50
+        return input.substring(input.length() - 3);
51
+
46
     }
52
     }
47
 
53
 
48
     /**
54
     /**
51
      * @return the equivalence of two strings, `inputValue` and `comparableValue`
57
      * @return the equivalence of two strings, `inputValue` and `comparableValue`
52
      */
58
      */
53
     public static Boolean compareTwoStrings(String inputValue, String comparableValue){
59
     public static Boolean compareTwoStrings(String inputValue, String comparableValue){
54
-        return null;
60
+
61
+        return inputValue.equals(comparableValue);
55
     }
62
     }
56
 
63
 
57
     /**
64
     /**
59
      * @return the middle character of `inputValue`
66
      * @return the middle character of `inputValue`
60
      */
67
      */
61
     public static Character getMiddleCharacter(String inputValue){
68
     public static Character getMiddleCharacter(String inputValue){
62
-        return null;
69
+
70
+        double middle = inputValue.length() / 2;
71
+        int makeWhole = (int)middle;
72
+
73
+        if (inputValue.length() % 2 != 0){
74
+            return inputValue.charAt(makeWhole);
75
+        } else {
76
+            return inputValue.charAt(makeWhole - 1);
77
+        }
78
+
79
+
63
     }
80
     }
64
 
81
 
65
     /**
82
     /**
67
      * @return the first sequence of characters
84
      * @return the first sequence of characters
68
      */
85
      */
69
     public static String getFirstWord(String spaceDelimitedString){
86
     public static String getFirstWord(String spaceDelimitedString){
70
-        return null;
87
+
88
+        String arr[] = spaceDelimitedString.split(" ", 2);
89
+
90
+        String firstWord = arr[0];
91
+        //String restOfWords = arr[1];
92
+
93
+        return firstWord;
94
+
71
     }
95
     }
72
 
96
 
73
     /**
97
     /**
75
      * @return the second word of a string delimited by spaces.
99
      * @return the second word of a string delimited by spaces.
76
      */
100
      */
77
     public static String getSecondWord(String spaceDelimitedString){
101
     public static String getSecondWord(String spaceDelimitedString){
78
-        return null;
102
+
103
+        String arr[] = spaceDelimitedString.split(" ", 2);
104
+
105
+        //String = arr[0];
106
+        //String = arr[1];
107
+
108
+        return arr[1];
109
+
79
     }
110
     }
80
 
111
 
81
     /**
112
     /**
83
      * @return an identical string with characters in reverse order.
114
      * @return an identical string with characters in reverse order.
84
      */
115
      */
85
     public static String reverseTheTwo(String stringToReverse){
116
     public static String reverseTheTwo(String stringToReverse){
86
-        return null;
117
+
118
+        //String x = "A string";
119
+        String reverse = "";
120
+
121
+        for(int i = stringToReverse.length()-1; i >= 0; i--){
122
+            reverse = reverse + stringToReverse.charAt(i);
123
+        }
124
+
125
+        return reverse;
87
     }
126
     }
88
 }
127
 }

+ 1
- 1
src/main/java/com/zipcodewilmington/danny_do_better_exercises/ZipcodeRocks.java 查看文件

5
  */
5
  */
6
 public class ZipcodeRocks {
6
 public class ZipcodeRocks {
7
     public static void main(String[] args) {
7
     public static void main(String[] args) {
8
-//         System.out.println("Zipcode Rocks!");
8
+         System.out.println("Zipcode Rocks!");
9
     }
9
     }
10
 }
10
 }

+ 3
- 3
src/test/java/com/zipcodewilmington/danny_do_better_exercises/TestMathUtilities.java 查看文件

36
         // : Given
36
         // : Given
37
         short baseValue = 16384;
37
         short baseValue = 16384;
38
         short addedValue = 7;
38
         short addedValue = 7;
39
-        short expected = 32767;
39
+        short expected = 16391;
40
         // : When
40
         // : When
41
         short actual = primativeTypes.add(baseValue, addedValue);
41
         short actual = primativeTypes.add(baseValue, addedValue);
42
         // : Then
42
         // : Then
146
         // : When
146
         // : When
147
         float actualFloat = primativeTypes.subtract(baseValue,difference);
147
         float actualFloat = primativeTypes.subtract(baseValue,difference);
148
         // : Then
148
         // : Then
149
-        assertEquals(expectedFloat,actualFloat, 0);
149
+        assertEquals(expectedFloat,actualFloat, 0.005);
150
     }
150
     }
151
     @Test
151
     @Test
152
     public void testSubtractions5() {
152
     public void testSubtractions5() {
296
         // : Given
296
         // : Given
297
         byte multiplicand = 16;
297
         byte multiplicand = 16;
298
         byte multiplier = 14;
298
         byte multiplier = 14;
299
-        byte expectedByte = 64;
299
+        byte expectedByte = -32;
300
         // : When
300
         // : When
301
         byte actualByte = primativeTypes.multiply(multiplicand, multiplier);
301
         byte actualByte = primativeTypes.multiply(multiplicand, multiplier);
302
         // : Then
302
         // : Then

+ 3
- 3
src/test/java/com/zipcodewilmington/danny_do_better_exercises/TestPredicateUtilities.java 查看文件

33
         boolean outcome = math.isGreaterThan(greaterValue, lesserValue);
33
         boolean outcome = math.isGreaterThan(greaterValue, lesserValue);
34
 
34
 
35
         // : Then
35
         // : Then
36
-        assertTrue(outcome);
36
+        assertFalse(outcome);
37
     }
37
     }
38
 
38
 
39
 
39
 
62
         boolean outcome = math.isLessThan(greaterValue, lesserValue);
62
         boolean outcome = math.isLessThan(greaterValue, lesserValue);
63
 
63
 
64
         // : Then
64
         // : Then
65
-        assertTrue(outcome);
65
+        assertFalse(outcome);
66
     }
66
     }
67
 
67
 
68
 
68
 
116
         boolean outcome = math.isGreaterThanOrEqualTo(greaterValue, lesserValue);
116
         boolean outcome = math.isGreaterThanOrEqualTo(greaterValue, lesserValue);
117
 
117
 
118
         // : Then
118
         // : Then
119
-        assertTrue(outcome);
119
+        assertFalse(outcome);
120
     }
120
     }
121
 }
121
 }

+ 2
- 2
src/test/java/com/zipcodewilmington/danny_do_better_exercises/TestStringUtilities.java 查看文件

56
     public void substringBeginTest(){
56
     public void substringBeginTest(){
57
         // : Given
57
         // : Given
58
         String input = "Hello";
58
         String input = "Hello";
59
-        String expected = "olleH";
59
+        String expected = "Hel";
60
 
60
 
61
         // : When
61
         // : When
62
         String actual = StringUtilities.getPrefix(input);
62
         String actual = StringUtilities.getPrefix(input);
154
         String expected = "Wilmington";
154
         String expected = "Wilmington";
155
 
155
 
156
         // : When
156
         // : When
157
-        String actual = StringUtilities.getFirstWord(input);
157
+        String actual = StringUtilities.getSecondWord(input);
158
 
158
 
159
         // : Then
159
         // : Then
160
         assertEquals(expected, actual);
160
         assertEquals(expected, actual);

二进制
target/classes/com/zipcodewilmington/danny_do_better_exercises/MathUtilities.class 查看文件


二进制
target/classes/com/zipcodewilmington/danny_do_better_exercises/PredicateUtilities.class 查看文件


二进制
target/classes/com/zipcodewilmington/danny_do_better_exercises/StringUtilities.class 查看文件


二进制
target/classes/com/zipcodewilmington/danny_do_better_exercises/ZipcodeRocks.class 查看文件


二进制
target/test-classes/com/zipcodewilmington/danny_do_better_exercises/TestMathUtilities.class 查看文件


二进制
target/test-classes/com/zipcodewilmington/danny_do_better_exercises/TestPredicateUtilities.class 查看文件


二进制
target/test-classes/com/zipcodewilmington/danny_do_better_exercises/TestStringUtilities.class 查看文件