Leon 6 anni fa
parent
commit
be3581ed9e

+ 1
- 0
.idea/.name Vedi File

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

+ 16
- 0
.idea/compiler.xml Vedi File

@@ -0,0 +1,16 @@
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 target="1.8">
13
+      <module name="ChapterOneMicro" target="1.8" />
14
+    </bytecodeTargetLevel>
15
+  </component>
16
+</project>

+ 7
- 0
.idea/kotlinc.xml Vedi File

@@ -0,0 +1,7 @@
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>

+ 90
- 0
.idea/misc.xml Vedi File

@@ -0,0 +1,90 @@
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="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">
27
+    <output url="file://$PROJECT_DIR$/classes" />
28
+  </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>

+ 8
- 0
.idea/modules.xml Vedi File

@@ -0,0 +1,8 @@
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>

+ 6
- 0
.idea/vcs.xml Vedi File

@@ -0,0 +1,6 @@
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>

+ 16
- 0
ChapterOneMicro.iml Vedi File

@@ -0,0 +1,16 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
4
+    <output url="file://$MODULE_DIR$/target/classes" />
5
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
+    <content url="file://$MODULE_DIR$">
7
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8
+      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
9
+      <excludeFolder url="file://$MODULE_DIR$/target" />
10
+    </content>
11
+    <orderEntry type="inheritedJdk" />
12
+    <orderEntry type="sourceFolder" forTests="false" />
13
+    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
14
+    <orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
15
+  </component>
16
+</module>

+ 0
- 13
src/main/java/HelloWorld/HelloWorld.java Vedi File

@@ -1,13 +0,0 @@
1
-package HelloWorld;
2
-
3
-/**
4
- * Created by dan on 6/14/17.
5
- */
6
-public class HelloWorld {
7
-
8
-    //Should return hello world as a string
9
-    public String helloWorld(){
10
-        return null;
11
-    }
12
-
13
-}

+ 0
- 63
src/main/java/Math/Math.java Vedi File

@@ -1,63 +0,0 @@
1
-package Math;
2
-
3
-/**
4
- * Created by dan on 6/14/17.
5
- */
6
-public class Math {
7
-
8
-    //Get the remainder from division
9
-    public int remainder(int one, int two){
10
-        return 0;
11
-    }
12
-
13
-    //Return true using greater than symbol
14
-    public boolean greaterThanTrue(int one, int two){
15
-        return false;
16
-    }
17
-
18
-    //Return false using greater than symbol
19
-    public boolean greaterThanFalse(int one, int two){
20
-        return true;
21
-    }
22
-
23
-    //Return true using less than symbol
24
-    public boolean lessThanTrue(int one, int two){
25
-        return false;
26
-    }
27
-
28
-    //Return false using less than symbol
29
-    public boolean lessThanFalse(int one, int two){
30
-        return true;
31
-    }
32
-
33
-    //Return true using greater or equal symbol
34
-    public boolean greaterOrEqualTrue(int one, int two){
35
-        return false;
36
-    }
37
-
38
-    //Return false using greater or equal symbol
39
-    public boolean greaterOrEqualFalse(int one, int two){
40
-        return true;
41
-    }
42
-
43
-    //Return true using less than or equal symbol
44
-    public boolean lessOrEqualTrue(int one, int two){
45
-        return false;
46
-    }
47
-
48
-    //Return false using less than or equal symbol
49
-    public boolean lessOrEqualFalse(int one, int two){
50
-        return true;
51
-    }
52
-
53
-    //Return true if the number in parameter is equal to 3 and less than 90
54
-    public boolean logicalAnd(Integer number){
55
-        return false;
56
-    }
57
-
58
-    //Return true if the number passed in is equal to 4 or greater than 100
59
-    public boolean logicalOr(Integer number){
60
-        return false;
61
-    }
62
-
63
-}

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

@@ -0,0 +1,11 @@
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
+}

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

@@ -0,0 +1,41 @@
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
+}

src/main/java/PrimativeTypes/PrimativeTypes.java → src/main/java/com/zipcodewilmington/danny_do_better/PrimativeTypes.java Vedi File

@@ -1,4 +1,4 @@
1
-package PrimativeTypes;
1
+package com.zipcodewilmington.danny_do_better;
2 2
 
3 3
 /**
4 4
  * Created by dan on 6/14/17.

src/main/java/Strings/Strings.java → src/main/java/com/zipcodewilmington/danny_do_better/Strings.java Vedi File

@@ -1,4 +1,4 @@
1
-package Strings;
1
+package com.zipcodewilmington.danny_do_better;
2 2
 
3 3
 /**
4 4
  * Created by dan on 6/14/17.

+ 0
- 67
src/test/java/Math/MathTest.java Vedi File

@@ -1,67 +0,0 @@
1
-package Math;
2
-
3
-import org.junit.Before;
4
-import org.junit.Test;
5
-import static org.junit.Assert.*;
6
-/**
7
- * Created by dan on 6/14/17.
8
- */
9
-public class MathTest {
10
-
11
-
12
-    Math math;
13
-
14
-    @Before public void initialize(){
15
-        math = new Math();
16
-    }
17
-
18
-    @Test
19
-    public void testRemainder(){
20
-        Integer one = 7, two = 3;
21
-        Integer expected = 1;
22
-        Integer actual = this.math.remainder(one, two);
23
-
24
-        assertTrue(expected == actual);
25
-    }
26
-
27
-    @Test
28
-    public void testGreaterThan(){
29
-        assertTrue(this.math.greaterThanTrue(456,23));
30
-        assertFalse(this.math.greaterThanFalse(1,3));
31
-    }
32
-
33
-    @Test
34
-    public void testLessThan(){
35
-        assertTrue(this.math.lessThanTrue(1 ,3));
36
-        assertFalse(this.math.lessThanFalse(4,1));
37
-    }
38
-
39
-    @Test
40
-    public void testLessOrEqual(){
41
-        assertTrue(this.math.lessOrEqualTrue(3 , 3));
42
-        assertTrue(this.math.lessOrEqualTrue(3, 6));
43
-        assertFalse(this.math.lessOrEqualFalse(3, 1));
44
-    }
45
-
46
-    @Test
47
-    public void testGreaterOrEqual(){
48
-        assertTrue(this.math.greaterOrEqualTrue(4, 4));
49
-        assertTrue(this.math.greaterOrEqualTrue(78, 5));
50
-        assertFalse(this.math.greaterOrEqualFalse(4, 56));
51
-    }
52
-
53
-    @Test
54
-    public void testLogicalAnd(){
55
-        assertTrue(this.math.logicalAnd(3));
56
-        assertFalse(this.math.logicalAnd(4));
57
-    }
58
-
59
-    @Test
60
-    public void testLogicalOr(){
61
-        assertTrue(this.math.logicalOr(4));
62
-        assertTrue(this.math.logicalOr(14564));
63
-        assertFalse(this.math.logicalOr(54));
64
-    }
65
-
66
-
67
-}

src/test/java/HelloWorld/HelloWorldTest.java → src/test/java/com/zipcodewilmington/danny_do_better/HelloWorldTest.java Vedi File

@@ -1,16 +1,19 @@
1
-package HelloWorld;
1
+package com.zipcodewilmington.danny_do_better;
2 2
 
3 3
 import org.junit.Before;
4 4
 import org.junit.Test;
5
-import static org.junit.Assert.*;
5
+
6
+import static org.junit.Assert.assertEquals;
7
+
6 8
 /**
7
- * Created by dan on 6/14/17.
9
+ * Created by leon on 2/1/18.
8 10
  */
9 11
 public class HelloWorldTest {
10 12
 
11 13
     HelloWorld helloWorld;
12 14
 
13
-    @Before public void initialize(){
15
+    @Before
16
+    public void initialize(){
14 17
         helloWorld = new HelloWorld();
15 18
     }
16 19
 
@@ -22,4 +25,4 @@ public class HelloWorldTest {
22 25
         assertEquals(expected,actual);
23 26
     }
24 27
 
25
-}
28
+}

+ 65
- 0
src/test/java/com/zipcodewilmington/danny_do_better/MathUtilitiesTest.java Vedi File

@@ -0,0 +1,65 @@
1
+package com.zipcodewilmington.danny_do_better;
2
+
3
+import org.junit.Before;
4
+import org.junit.Test;
5
+import static org.junit.Assert.*;
6
+/**
7
+ * Created by dan on 6/14/17.
8
+ */
9
+public class MathUtilitiesTest {
10
+
11
+
12
+    MathUtilities math;
13
+
14
+    @Before public void initialize(){
15
+        math = new MathUtilities();
16
+    }
17
+
18
+    @Test
19
+    public void testRemainder(){
20
+        Integer dividend = 7;
21
+        Integer divisor = 3;
22
+        Integer expected = 1;
23
+
24
+        Integer actual = this.math.remainder(dividend, divisor);
25
+
26
+        assertTrue(expected == actual);
27
+    }
28
+
29
+    @Test
30
+    public void testGreaterThan(){
31
+        assertTrue(this.math.isGreaterThan(456,23));
32
+    }
33
+
34
+    @Test
35
+    public void testLessThan(){
36
+        assertTrue(this.math.isLessThan(1 ,3));
37
+    }
38
+
39
+    @Test
40
+    public void testLessOrEqual(){
41
+        assertTrue(this.math.isLessThanOrEqualTo(3 , 3));
42
+        assertTrue(this.math.isLessThanOrEqualTo(3, 6));
43
+    }
44
+
45
+    @Test
46
+    public void testGreaterOrEqual(){
47
+        assertTrue(this.math.isGreaterThanOrEqualTo(4, 4));
48
+        assertTrue(this.math.isGreaterThanOrEqualTo(78, 5));
49
+    }
50
+
51
+    @Test
52
+    public void testLogicalAnd(){
53
+        assertTrue(this.math.isBoth(3));
54
+        assertFalse(this.math.isBoth(4));
55
+    }
56
+
57
+    @Test
58
+    public void testLogicalOr(){
59
+        assertTrue(this.math.logicalOr(4));
60
+        assertTrue(this.math.logicalOr(14564));
61
+        assertFalse(this.math.logicalOr(54));
62
+    }
63
+
64
+
65
+}

src/test/java/PrimativeTypes/PrimativeTypesTest.java → src/test/java/com/zipcodewilmington/danny_do_better/PrimativeTypesTest.java Vedi File

@@ -1,5 +1,6 @@
1
-package PrimativeTypes;
1
+package com.zipcodewilmington.danny_do_better;
2 2
 
3
+import com.zipcodewilmington.danny_do_better.PrimativeTypes;
3 4
 import org.junit.Before;
4 5
 import org.junit.Test;
5 6
 import static org.junit.Assert.*;

src/test/java/Strings/StringsTest.java → src/test/java/com/zipcodewilmington/danny_do_better/StringsTest.java Vedi File

@@ -1,5 +1,6 @@
1
-package Strings;
1
+package com.zipcodewilmington.danny_do_better;
2 2
 
3
+import com.zipcodewilmington.danny_do_better.Strings;
3 4
 import org.junit.Before;
4 5
 import org.junit.Test;
5 6
 import static org.junit.Assert.*;