Ben Blinebury vor 6 Jahren
Ursprung
Commit
c70ca4f03f
10 geänderte Dateien mit 405 neuen und 0 gelöschten Zeilen
  1. 9
    0
      .idea/FizzBuzz-TDD.iml
  2. 6
    0
      .idea/misc.xml
  3. 6
    0
      .idea/vcs.xml
  4. 212
    0
      .idea/workspace.xml
  5. BIN
      FizzBuzz.class
  6. 9
    0
      FizzBuzz.ctxt
  7. 37
    0
      FizzBuzz.java
  8. BIN
      FizzBuzzTest.class
  9. 24
    0
      FizzBuzzTest.ctxt
  10. 102
    0
      FizzBuzzTest.java

+ 9
- 0
.idea/FizzBuzz-TDD.iml Datei anzeigen

@@ -0,0 +1,9 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module type="JAVA_MODULE" version="4">
3
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+    <exclude-output />
5
+    <content url="file://$MODULE_DIR$" />
6
+    <orderEntry type="inheritedJdk" />
7
+    <orderEntry type="sourceFolder" forTests="false" />
8
+  </component>
9
+</module>

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

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="JavaScriptSettings">
4
+    <option name="languageLevel" value="ES6" />
5
+  </component>
6
+</project>

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

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

+ 212
- 0
.idea/workspace.xml Datei anzeigen

@@ -0,0 +1,212 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="1a08e6f6-8f86-4d42-ad2b-225d7121f67a" name="Default" comment="" />
5
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
6
+    <option name="TRACKING_ENABLED" value="true" />
7
+    <option name="SHOW_DIALOG" value="false" />
8
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
9
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
10
+    <option name="LAST_RESOLUTION" value="IGNORE" />
11
+  </component>
12
+  <component name="FileEditorManager">
13
+    <leaf>
14
+      <file leaf-file-name="README.MD" pinned="false" current-in-tab="false">
15
+        <entry file="file://$PROJECT_DIR$/README.MD">
16
+          <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
17
+            <state split_layout="SPLIT">
18
+              <first_editor />
19
+              <second_editor />
20
+            </state>
21
+          </provider>
22
+        </entry>
23
+      </file>
24
+      <file leaf-file-name="package.bluej" pinned="false" current-in-tab="true">
25
+        <entry file="file://$PROJECT_DIR$/package.bluej">
26
+          <provider selected="true" editor-type-id="text-editor" />
27
+        </entry>
28
+      </file>
29
+    </leaf>
30
+  </component>
31
+  <component name="Git.Settings">
32
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
33
+  </component>
34
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
35
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
36
+  <component name="JsGulpfileManager">
37
+    <detection-done>true</detection-done>
38
+    <sorting>DEFINITION_ORDER</sorting>
39
+  </component>
40
+  <component name="NodePackageJsonFileManager">
41
+    <packageJsonPaths />
42
+  </component>
43
+  <component name="ProjectFrameBounds" fullScreen="true">
44
+    <option name="width" value="1440" />
45
+    <option name="height" value="900" />
46
+  </component>
47
+  <component name="ProjectLevelVcsManager">
48
+    <ConfirmationsSetting value="1" id="Add" />
49
+  </component>
50
+  <component name="ProjectView">
51
+    <navigator proportions="" version="1">
52
+      <foldersAlwaysOnTop value="true" />
53
+    </navigator>
54
+    <panes>
55
+      <pane id="Scope" />
56
+      <pane id="AndroidView" />
57
+      <pane id="ProjectPane">
58
+        <subPane>
59
+          <expand>
60
+            <path>
61
+              <item name="FizzBuzz-TDD" type="b2602c69:ProjectViewProjectNode" />
62
+              <item name="FizzBuzz-TDD" type="462c0819:PsiDirectoryNode" />
63
+            </path>
64
+            <path>
65
+              <item name="FizzBuzz-TDD" type="b2602c69:ProjectViewProjectNode" />
66
+              <item name="FizzBuzz-TDD" type="462c0819:PsiDirectoryNode" />
67
+              <item name=".idea" type="462c0819:PsiDirectoryNode" />
68
+            </path>
69
+          </expand>
70
+          <select />
71
+        </subPane>
72
+      </pane>
73
+      <pane id="PackagesPane" />
74
+    </panes>
75
+  </component>
76
+  <component name="PropertiesComponent">
77
+    <property name="WebServerToolWindowFactoryState" value="false" />
78
+    <property name="aspect.path.notification.shown" value="true" />
79
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
80
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
81
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
82
+    <property name="settings.editor.selected.configurable" value="editor.preferences.import" />
83
+  </component>
84
+  <component name="RunDashboard">
85
+    <option name="ruleStates">
86
+      <list>
87
+        <RuleState>
88
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
89
+        </RuleState>
90
+        <RuleState>
91
+          <option name="name" value="StatusDashboardGroupingRule" />
92
+        </RuleState>
93
+      </list>
94
+    </option>
95
+  </component>
96
+  <component name="RunManager">
97
+    <configuration default="true" type="Application" factoryName="Application">
98
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
99
+    </configuration>
100
+    <configuration default="true" type="JUnit" factoryName="JUnit">
101
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
102
+      <option name="ALTERNATIVE_JRE_PATH" />
103
+      <option name="PACKAGE_NAME" />
104
+      <option name="MAIN_CLASS_NAME" />
105
+      <option name="METHOD_NAME" />
106
+      <option name="TEST_OBJECT" value="class" />
107
+      <option name="VM_PARAMETERS" value="-ea" />
108
+      <option name="PARAMETERS" />
109
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
110
+      <option name="PASS_PARENT_ENVS" value="true" />
111
+      <option name="TEST_SEARCH_SCOPE">
112
+        <value defaultName="singleModule" />
113
+      </option>
114
+      <patterns />
115
+    </configuration>
116
+    <configuration default="true" type="TestNG" factoryName="TestNG">
117
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
118
+      <option name="ALTERNATIVE_JRE_PATH" />
119
+      <option name="SUITE_NAME" />
120
+      <option name="PACKAGE_NAME" />
121
+      <option name="MAIN_CLASS_NAME" />
122
+      <option name="METHOD_NAME" />
123
+      <option name="GROUP_NAME" />
124
+      <option name="TEST_OBJECT" value="CLASS" />
125
+      <option name="VM_PARAMETERS" value="-ea" />
126
+      <option name="PARAMETERS" />
127
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
128
+      <option name="OUTPUT_DIRECTORY" />
129
+      <option name="PASS_PARENT_ENVS" value="true" />
130
+      <option name="TEST_SEARCH_SCOPE">
131
+        <value defaultName="singleModule" />
132
+      </option>
133
+      <option name="USE_DEFAULT_REPORTERS" value="false" />
134
+      <option name="PROPERTIES_FILE" />
135
+      <properties />
136
+      <listeners />
137
+    </configuration>
138
+  </component>
139
+  <component name="SvnConfiguration">
140
+    <configuration />
141
+  </component>
142
+  <component name="TaskManager">
143
+    <task active="true" id="Default" summary="Default task">
144
+      <changelist id="1a08e6f6-8f86-4d42-ad2b-225d7121f67a" name="Default" comment="" />
145
+      <created>1529458410979</created>
146
+      <option name="number" value="Default" />
147
+      <option name="presentableId" value="Default" />
148
+      <updated>1529458410979</updated>
149
+      <workItem from="1529458412599" duration="124000" />
150
+    </task>
151
+    <servers />
152
+  </component>
153
+  <component name="TimeTrackingManager">
154
+    <option name="totallyTimeSpent" value="124000" />
155
+  </component>
156
+  <component name="ToolWindowManager">
157
+    <frame x="0" y="0" width="1440" height="900" extended-state="0" />
158
+    <editor active="true" />
159
+    <layout>
160
+      <window_info anchor="right" id="Palette" />
161
+      <window_info anchor="bottom" id="TODO" order="6" />
162
+      <window_info anchor="bottom" id="Messages" />
163
+      <window_info anchor="right" id="Palette&#9;" />
164
+      <window_info id="Image Layers" />
165
+      <window_info anchor="right" id="Capture Analysis" />
166
+      <window_info anchor="bottom" id="Event Log" side_tool="true" />
167
+      <window_info anchor="right" id="Maven Projects" />
168
+      <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
169
+      <window_info anchor="bottom" id="Run" order="2" />
170
+      <window_info anchor="bottom" id="Version Control" />
171
+      <window_info anchor="bottom" id="Terminal" />
172
+      <window_info id="Capture Tool" />
173
+      <window_info id="Designer" />
174
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.24964234" />
175
+      <window_info anchor="right" id="Database" />
176
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
177
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
178
+      <window_info id="UI Designer" />
179
+      <window_info anchor="right" id="Theme Preview" />
180
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
181
+      <window_info id="Favorites" side_tool="true" />
182
+      <window_info anchor="bottom" id="Find" order="1" />
183
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
184
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
185
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
186
+      <window_info anchor="bottom" id="Message" order="0" />
187
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
188
+    </layout>
189
+  </component>
190
+  <component name="TypeScriptGeneratedFilesManager">
191
+    <option name="version" value="1" />
192
+  </component>
193
+  <component name="VcsContentAnnotationSettings">
194
+    <option name="myLimit" value="2678400000" />
195
+  </component>
196
+  <component name="editorHistoryManager">
197
+    <entry file="file://$PROJECT_DIR$/.idea/modules.xml">
198
+      <provider selected="true" editor-type-id="text-editor" />
199
+    </entry>
200
+    <entry file="file://$PROJECT_DIR$/README.MD">
201
+      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
202
+        <state split_layout="SPLIT">
203
+          <first_editor />
204
+          <second_editor />
205
+        </state>
206
+      </provider>
207
+    </entry>
208
+    <entry file="file://$PROJECT_DIR$/package.bluej">
209
+      <provider selected="true" editor-type-id="text-editor" />
210
+    </entry>
211
+  </component>
212
+</project>

BIN
FizzBuzz.class Datei anzeigen


+ 9
- 0
FizzBuzz.ctxt Datei anzeigen

@@ -0,0 +1,9 @@
1
+#BlueJ class context
2
+comment0.target=FizzBuzz
3
+comment0.text=\n\ Write\ a\ description\ of\ class\ FizzBuzz\ here.\n\n\ @author\ (your\ name)\n\ @version\ (a\ version\ number\ or\ a\ date)\n
4
+comment1.params=
5
+comment1.target=FizzBuzz()
6
+comment1.text=\n\ Constructor\ for\ objects\ of\ class\ FizzBuzz\n
7
+comment2.params=input
8
+comment2.target=java.lang.String\ result(int)
9
+numComments=3

+ 37
- 0
FizzBuzz.java Datei anzeigen

@@ -0,0 +1,37 @@
1
+
2
+/**
3
+ * Write a description of class FizzBuzz here.
4
+ *
5
+ * @author (your name)
6
+ * @version (a version number or a date)
7
+ */
8
+public class FizzBuzz
9
+{
10
+    // instance variables - replace the example below with your own
11
+    private int x;
12
+
13
+    /**
14
+     * Constructor for objects of class FizzBuzz
15
+     */
16
+    public FizzBuzz(){
17
+    }
18
+    
19
+    public String result(int input) {
20
+        
21
+        
22
+        if (input % 3 == 0 && input % 5 == 0) {
23
+            return "FizzBuzz";
24
+        }
25
+        else if(input % 3 == 0) {
26
+            return "Fizz";
27
+        }
28
+        else if (input % 5 == 0) {
29
+            return "Buzz";
30
+        }
31
+        else {
32
+            return String.valueOf(input);
33
+        }
34
+    }
35
+    
36
+    
37
+}

BIN
FizzBuzzTest.class Datei anzeigen


+ 24
- 0
FizzBuzzTest.ctxt Datei anzeigen

@@ -0,0 +1,24 @@
1
+#BlueJ class context
2
+comment0.target=FizzBuzzTest
3
+comment0.text=\n\ The\ test\ class\ FizzBuzzTest.\n\n\ @author\ \ (your\ name)\n\ @version\ (a\ version\ number\ or\ a\ date)\n
4
+comment1.params=
5
+comment1.target=FizzBuzzTest()
6
+comment1.text=\n\ Default\ constructor\ for\ test\ class\ FizzBuzzTest\n
7
+comment2.params=
8
+comment2.target=void\ setup()
9
+comment2.text=\n\ Sets\ up\ the\ test\ fixture.\n\n\ Called\ before\ every\ test\ case\ method.\n
10
+comment3.params=
11
+comment3.target=void\ fizzTest1()
12
+comment4.params=
13
+comment4.target=void\ fizzTest2()
14
+comment5.params=
15
+comment5.target=void\ buzzTest1()
16
+comment6.params=
17
+comment6.target=void\ buzzTest2()
18
+comment7.params=
19
+comment7.target=void\ fizzBuzzTest1()
20
+comment8.params=
21
+comment8.target=void\ fizzBuzzTest2()
22
+comment9.params=
23
+comment9.target=void\ numberTest()
24
+numComments=10

+ 102
- 0
FizzBuzzTest.java Datei anzeigen

@@ -0,0 +1,102 @@
1
+
2
+
3
+import static org.junit.Assert.*;
4
+import org.junit.After;
5
+import org.junit.Before;
6
+import org.junit.Test;
7
+
8
+/**
9
+ * The test class FizzBuzzTest.
10
+ *
11
+ * @author  (your name)
12
+ * @version (a version number or a date)
13
+ */
14
+public class FizzBuzzTest
15
+{
16
+    /**
17
+     * Default constructor for test class FizzBuzzTest
18
+     */
19
+    public FizzBuzzTest()
20
+    {
21
+    }
22
+    private FizzBuzz fizzBuzz;
23
+    /**
24
+     * Sets up the test fixture.
25
+     *
26
+     * Called before every test case method.
27
+     */
28
+    @Before
29
+    public void setup() {
30
+        fizzBuzz = new FizzBuzz();
31
+    }
32
+    
33
+    @Test
34
+    public void fizzTest1() {
35
+        //given
36
+        String expected = "Fizz";
37
+        //when
38
+        String actual = fizzBuzz.result(3);
39
+        //then
40
+        assertEquals(expected, actual);
41
+    }
42
+    
43
+    @Test
44
+    public void fizzTest2() {
45
+        //given
46
+        String expected = "Fizz";
47
+        //when
48
+        String actual = fizzBuzz.result(9);
49
+        //then
50
+        assertEquals(expected, actual);
51
+    }
52
+    
53
+    @Test
54
+    public void buzzTest1() {
55
+        //given
56
+        String expected = "Buzz";
57
+        //when
58
+        String actual = fizzBuzz.result(5);
59
+        //then
60
+        assertEquals(expected, actual);
61
+    }
62
+    
63
+    @Test
64
+    public void buzzTest2() {
65
+        //given
66
+        String expected = "Buzz";
67
+        //when
68
+        String actual = fizzBuzz.result(20);
69
+        //then
70
+        assertEquals(expected, actual);
71
+    }
72
+    
73
+    @Test
74
+    public void fizzBuzzTest1() {
75
+        //given
76
+        String expected = "FizzBuzz";
77
+        //when
78
+        String actual = fizzBuzz.result(15);
79
+        //then
80
+        assertEquals(expected, actual);
81
+    }
82
+    
83
+    @Test
84
+    public void fizzBuzzTest2() {
85
+        //given
86
+        String expected = "FizzBuzz";
87
+        //when
88
+        String actual = fizzBuzz.result(30);
89
+        //then
90
+        assertEquals(expected, actual);
91
+    }
92
+    
93
+    @Test
94
+    public void numberTest() {
95
+        //given
96
+        String expected = "11";
97
+        //when
98
+        String actual = fizzBuzz.result(11);
99
+        //then
100
+        assertEquals(expected, actual);
101
+    }
102
+}