Quellcode durchsuchen

merge conflicts

Carolynn Vansant vor 6 Jahren
Ursprung
Commit
c92e460b5e

+ 6
- 57
.gitignore Datei anzeigen

@@ -1,57 +1,6 @@
1
-er-specific stuff:
2
-.idea/**/workspace.xml
3
-.idea/**/tasks.xml
4
-.idea/dictionaries
5
-
6
-# Sensitive or high-churn files:
7
-.idea/**/dataSources/
8
-.idea/**/dataSources.ids
9
-.idea/**/dataSources.xml
10
-.idea/**/dataSources.local.xml
11
-.idea/**/sqlDataSources.xml
12
-.idea/**/dynamic.xml
13
-.idea/**/uiDesigner.xml
14
-
15
-# Gradle:
16
-.idea/**/gradle.xml
17
-.idea/**/libraries
18
-
19
-# CMake
20
-cmake-build-debug/
21
-
22
-# Mongo Explorer plugin:
23
-.idea/**/mongoSettings.xml
24
-
25
-## File-based project format:
26
-*.iws
27
-
28
-## Plugin-specific files:
29
-
30
-# IntelliJ
31
-/out/
32
-
33
-# mpeltonen/sbt-idea plugin
34
-.idea_modules/
35
-
36
-# JIRA plugin
37
-atlassian-ide-plugin.xml
38
-
39
-# Cursive Clojure plugin
40
-.idea/replstate.xml
41
-
42
-# Crashlytics plugin (for Android Studio and IntelliJ)
43
-com_crashlytics_export_strings.xml
44
-crashlytics.properties
45
-crashlytics-build.properties
46
-fabric.properties
47
-
48
-### Intellij Patch ###
49
-# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
50
-
51
-# *.iml
52
-# modules.xml
53
-# .idea/misc.xml
54
-# *.ipr
55
-
56
-# Sonarlint plugin
57
-.idea/sonarlint
1
+/target/
2
+.DS_Store
3
+.classpath
4
+#.project
5
+.settings
6
+.idea/

+ 0
- 1
.idea/.name Datei anzeigen

@@ -1 +0,0 @@
1
-ChapterOneMicro

+ 0
- 16
.idea/compiler.xml Datei anzeigen

@@ -1,16 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="CompilerConfiguration">
4
-    <annotationProcessing>
5
-      <profile name="Maven default annotation processors profile" enabled="true">
6
-        <sourceOutputDir name="target/generated-sources/annotations" />
7
-        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
8
-        <outputRelativeToContentRoot value="true" />
9
-        <module name="ChapterOneMicro" />
10
-      </profile>
11
-    </annotationProcessing>
12
-    <bytecodeTargetLevel>
13
-      <module name="ChapterOneMicro" target="1.8" />
14
-    </bytecodeTargetLevel>
15
-  </component>
16
-</project>

+ 0
- 13
.idea/misc.xml Datei anzeigen

@@ -1,13 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="MavenProjectsManager">
4
-    <option name="originalFiles">
5
-      <list>
6
-        <option value="$PROJECT_DIR$/pom.xml" />
7
-      </list>
8
-    </option>
9
-  </component>
10
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
11
-    <output url="file://$PROJECT_DIR$/classes" />
12
-  </component>
13
-</project>

+ 0
- 8
.idea/modules.xml Datei anzeigen

@@ -1,8 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="ProjectModuleManager">
4
-    <modules>
5
-      <module fileurl="file://$PROJECT_DIR$/ChapterOneMicro.iml" filepath="$PROJECT_DIR$/ChapterOneMicro.iml" />
6
-    </modules>
7
-  </component>
8
-</project>

+ 0
- 6
.idea/vcs.xml Datei anzeigen

@@ -1,6 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<project version="4">
3
-  <component name="VcsDirectoryMappings">
4
-    <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
-  </component>
6
-</project>

+ 29
- 29
README.md Datei anzeigen

@@ -1,38 +1,38 @@
1 1
 # Java Fundamentals
2 2
 
3
-* **Objective:**
4
-    * To complete the method stubs in each of the provided classes
5
-        * `MathUtilities`
6
-    	* `PredicateUtilities`
7
-    	* `StringUtilities`
8
-
9
-* **Purpose:**
10
-    * To establish familiarity with
11
-        * [primitive data-types](http://cs.fit.edu/~ryan/java/language/java-data.html)
12
-        * [method signatures and return statements](http://www.homeandlearn.co.uk/java/java_methods.html)
13
-        * [String operations](https://www.tutorialspoint.com/java/java_strings.htm)
14
-    
15
-* **Classes to be completed:**
3
+### **Objective:**
4
+* To complete the method stubs in each of the provided classes
16 5
 	* `MathUtilities`
17 6
 	* `PredicateUtilities`
18 7
 	* `StringUtilities`
8
+
9
+### **Purpose:**
10
+* To establish familiarity with
11
+    * [primitive data-types](http://cs.fit.edu/~ryan/java/language/java-data.html)
12
+    * [method signatures and return statements](http://www.homeandlearn.co.uk/java/java_methods.html)
13
+    * [String operations](https://www.tutorialspoint.com/java/java_strings.htm)
14
+    
15
+### **Classes to be completed:**
16
+* `MathUtilities`
17
+* `PredicateUtilities`
18
+* `StringUtilities`
19 19
 	
20
-* **Instructions**
20
+### **Instructions:**
21 21
 
22
-    1. Fork this Repository
23
-        * [fork](https://help.github.com/articles/fork-a-repo/) this repository to your personal github account 
24
-        * [clone](https://help.github.com/articles/cloning-a-repository/) **your** `forked` repository to your local machine.
25
-        * Complete steps 2 and 3  
26
-        * `git add` your changes to the list of your `commited` files.
27
-        * `git commit` your added files to the list of your `staged` files.
28
-        * `git push` your staged files to your remote repository.
29
-        * submit a `pull request` which compares Zipcoder `master` to your `master`.
30
-    2. Begin by first ensuring the `main` method in your `ZipcodeRocks` class prints `"Zipcode Rocks!"` upon execution.  
31
-    3. Complete each of the method stubs in each of the `main` classes provided.
32
-        * `main` classes are located in `src.main.java.com.zipcodewilmington.danny_do_better_exercises`
33
-        * There are comments above each method stub to describe the expected behavior.
34
-    4. Upon completion, open and run the `TestSuite` class to ensure that all tests have 100% success.
35
-        * `TestSuite` is located in `src.test.java.com.zipcodewilmington.danny_do_better_exercises`
22
+1. Fork this Repository
23
+    * [fork](https://help.github.com/articles/fork-a-repo/) this repository to your personal github account 
24
+    * [clone](https://help.github.com/articles/cloning-a-repository/) **your** `forked` repository to your local machine.
25
+    * Complete steps 2 and 3  
26
+    * `git add` your changes to the list of your `commited` files.
27
+    * `git commit` your added files to the list of your `staged` files.
28
+    * `git push` your staged files to your remote repository.
29
+    * submit a `pull request` which compares Zipcoder `master` to your `master`.
30
+2. Begin by first ensuring the `main` method in your `ZipcodeRocks` class prints `"Zipcode Rocks!"` upon execution.  
31
+3. Complete each of the method stubs in each of the `main` classes provided.
32
+    * `main` classes are located in `src.main.java.com.zipcodewilmington.danny_do_better_exercises`
33
+    * There are comments above each method stub to describe the expected behavior.
34
+4. Upon completion, open and run the `TestSuite` class to ensure that all tests have 100% success.
35
+    * `TestSuite` is located in `src.test.java.com.zipcodewilmington.danny_do_better_exercises`
36 36
 
37 37
 ## Predicate Utilities
38 38
 * A _predicate_ is a clause which states something about a subject. (_e.g., **is assigning**_ in _"Leon **is assigning** homework"_)
@@ -86,7 +86,7 @@
86 86
 	* `Character getMiddleCharacter(String)`
87 87
 	* `String getFirstWord(String)`
88 88
 	* `String getSecondWord(String)`
89
-	* `String reverseTheTwo(String)`
89
+	* `String reverse(String)`
90 90
 	
91 91
 	
92 92
 ## Whats next?

+ 8
- 2
src/main/java/com/zipcodewilmington/danny_do_better_exercises/StringUtilities.java Datei anzeigen

@@ -93,11 +93,17 @@ public class StringUtilities {
93 93
      * @param stringToReverse
94 94
      * @return an identical string with characters in reverse order.
95 95
      */
96
-    public static String reverseTheTwo(String stringToReverse){
96
+
97
+    public static String reverseTheTwo(String stringToReverse) {
97 98
         String reverse = "";
98
-        for(int i = stringToReverse.length()-1; i >= 0; i--) {
99
+        for (int i = stringToReverse.length() - 1; i >= 0; i--) {
99 100
             reverse += stringToReverse.charAt(i);
100 101
         }
101 102
         return reverse;
102 103
     }
104
+
105
+    public static String reverse(String stringToReverse){
106
+        return null;
107
+
108
+    }
103 109
 }

+ 2
- 2
src/test/java/com/zipcodewilmington/danny_do_better_exercises/TestMathUtilities.java Datei anzeigen

@@ -36,7 +36,7 @@ public class TestMathUtilities {
36 36
         // : Given
37 37
         short baseValue = 16384;
38 38
         short addedValue = 7;
39
-        short expected = 32767;
39
+        short expected = 16391;
40 40
         // : When
41 41
         short actual = primativeTypes.add(baseValue, addedValue);
42 42
         // : Then
@@ -146,7 +146,7 @@ public class TestMathUtilities {
146 146
         // : When
147 147
         float actualFloat = primativeTypes.subtract(baseValue,difference);
148 148
         // : Then
149
-        assertEquals(expectedFloat,actualFloat, 0);
149
+        assertEquals(expectedFloat,actualFloat, 0.005);
150 150
     }
151 151
     @Test
152 152
     public void testSubtractions5() {

+ 13
- 12
src/test/java/com/zipcodewilmington/danny_do_better_exercises/TestPredicateUtilities.java Datei anzeigen

@@ -1,7 +1,9 @@
1 1
 package com.zipcodewilmington.danny_do_better_exercises;
2 2
 
3 3
 import org.junit.Test;
4
+
4 5
 import static org.junit.Assert.*;
6
+
5 7
 /**
6 8
  * Created by dan on 6/14/17.
7 9
  */
@@ -9,7 +11,7 @@ public class TestPredicateUtilities {
9 11
     private static volatile PredicateUtilities math = new PredicateUtilities();
10 12
 
11 13
     @Test
12
-    public void testGreaterThanTrue(){
14
+    public void testGreaterThanTrue() {
13 15
         // : Given
14 16
         int greaterValue = 450;
15 17
         int lesserValue = 350;
@@ -24,7 +26,7 @@ public class TestPredicateUtilities {
24 26
 
25 27
 
26 28
     @Test
27
-    public void testGreaterThanFalse(){
29
+    public void testGreaterThanFalse() {
28 30
         // : Given
29 31
         int greaterValue = 350;
30 32
         int lesserValue = 350;
@@ -33,12 +35,12 @@ public class TestPredicateUtilities {
33 35
         boolean outcome = math.isGreaterThan(greaterValue, lesserValue);
34 36
 
35 37
         // : Then
36
-        assertTrue(outcome);
38
+        assertFalse(outcome);
37 39
     }
38 40
 
39 41
 
40 42
     @Test
41
-    public void testLessThanTrue(){
43
+    public void testLessThanTrue() {
42 44
         // : Given
43 45
         int greaterValue = 450;
44 46
         int lesserValue = 350;
@@ -51,9 +53,8 @@ public class TestPredicateUtilities {
51 53
     }
52 54
 
53 55
 
54
-
55 56
     @Test
56
-    public void testLessThan1(){
57
+    public void testLessThan1() {
57 58
         // : Given
58 59
         int greaterValue = 450;
59 60
         int lesserValue = 350;
@@ -62,12 +63,12 @@ public class TestPredicateUtilities {
62 63
         boolean outcome = math.isLessThan(greaterValue, lesserValue);
63 64
 
64 65
         // : Then
65
-        assertTrue(outcome);
66
+        assertFalse(outcome);
66 67
     }
67 68
 
68 69
 
69 70
     @Test
70
-    public void testLessOrEqual1(){
71
+    public void testLessOrEqual1() {
71 72
         // : Given
72 73
         int greaterValue = 3;
73 74
         int lesserValue = 3;
@@ -80,7 +81,7 @@ public class TestPredicateUtilities {
80 81
     }
81 82
 
82 83
     @Test
83
-    public void testLessOrEqual2(){
84
+    public void testLessOrEqual2() {
84 85
         // : Given
85 86
         int greaterValue = 3;
86 87
         int lesserValue = 6;
@@ -93,7 +94,7 @@ public class TestPredicateUtilities {
93 94
     }
94 95
 
95 96
     @Test
96
-    public void testGreaterOrEqual1(){
97
+    public void testGreaterOrEqual1() {
97 98
         // : Given
98 99
         int greaterValue = 4;
99 100
         int lesserValue = 4;
@@ -107,7 +108,7 @@ public class TestPredicateUtilities {
107 108
 
108 109
 
109 110
     @Test
110
-    public void testGreaterOrEqual2(){
111
+    public void testGreaterOrEqual2() {
111 112
         // : Given
112 113
         int greaterValue = 8;
113 114
         int lesserValue = 15;
@@ -116,6 +117,6 @@ public class TestPredicateUtilities {
116 117
         boolean outcome = math.isGreaterThanOrEqualTo(greaterValue, lesserValue);
117 118
 
118 119
         // : Then
119
-        assertTrue(outcome);
120
+        assertFalse(outcome);
120 121
     }
121 122
 }

+ 6
- 6
src/test/java/com/zipcodewilmington/danny_do_better_exercises/TestStringUtilities.java Datei anzeigen

@@ -56,7 +56,7 @@ public class TestStringUtilities {
56 56
     public void substringBeginTest(){
57 57
         // : Given
58 58
         String input = "Hello";
59
-        String expected = "olleH";
59
+        String expected = "Hel";
60 60
 
61 61
         // : When
62 62
         String actual = StringUtilities.getPrefix(input);
@@ -109,13 +109,13 @@ public class TestStringUtilities {
109 109
     public void getTheMiddleChar1(){
110 110
         // : Given
111 111
         String input = "Zipcode";
112
-        char expected = 'c';
112
+        Character expected = 'c';
113 113
 
114 114
         // : When
115
-        char actual = StringUtilities.getMiddleCharacter(input);
115
+        Character actual = StringUtilities.getMiddleCharacter(input);
116 116
 
117 117
         // : Then
118
-        Assert.assertEquals(expected, actual);
118
+        Assert.assertEquals(expected.toString(), actual.toString());
119 119
     }
120 120
 
121 121
 
@@ -154,7 +154,7 @@ public class TestStringUtilities {
154 154
         String expected = "Wilmington";
155 155
 
156 156
         // : When
157
-        String actual = StringUtilities.getFirstWord(input);
157
+        String actual = StringUtilities.getSecondWord(input);
158 158
 
159 159
         // : Then
160 160
         assertEquals(expected, actual);
@@ -168,7 +168,7 @@ public class TestStringUtilities {
168 168
 
169 169
 
170 170
         // : When
171
-        String actual = StringUtilities.reverseTheTwo(input);
171
+        String actual = StringUtilities.reverse(input);
172 172
 
173 173
         // : Then
174 174
         assertEquals(expected, actual);

BIN
target/classes/com/zipcodewilmington/danny_do_better_exercises/MathUtilities.class Datei anzeigen


BIN
target/classes/com/zipcodewilmington/danny_do_better_exercises/PredicateUtilities.class Datei anzeigen


BIN
target/classes/com/zipcodewilmington/danny_do_better_exercises/StringUtilities.class Datei anzeigen


BIN
target/classes/com/zipcodewilmington/danny_do_better_exercises/ZipcodeRocks.class Datei anzeigen


BIN
target/test-classes/com/zipcodewilmington/danny_do_better_exercises/TestMathUtilities.class Datei anzeigen


BIN
target/test-classes/com/zipcodewilmington/danny_do_better_exercises/TestPredicateUtilities.class Datei anzeigen


BIN
target/test-classes/com/zipcodewilmington/danny_do_better_exercises/TestStringUtilities.class Datei anzeigen


BIN
target/test-classes/com/zipcodewilmington/danny_do_better_exercises/TestSuite.class Datei anzeigen