Arin Turpin 6 лет назад
Родитель
Сommit
eadf903839
13 измененных файлов: 239 добавлений и 141 удалений
  1. 12
    1
      .idea/Ken_s_Pianos_3.iml
  2. 119
    39
      .idea/workspace.xml
  3. Двоичные данные
      out/production/Ken_s_Pianos_3/Piano$SIZE.class
  4. Двоичные данные
      out/production/Ken_s_Pianos_3/Piano.class
  5. Двоичные данные
      out/production/Ken_s_Pianos_3/PianoRoom.class
  6. Двоичные данные
      out/production/Ken_s_Pianos_3/main/Piano$SIZE.class
  7. Двоичные данные
      out/production/Ken_s_Pianos_3/main/Piano.class
  8. Двоичные данные
      out/test/Ken_s_Pianos_3/testsForEverything.class
  9. 0
    84
      src/main/Piano.java
  10. 0
    17
      src/main/PianoRoom.java
  11. 25
    0
      src/main/java/Piano.java
  12. 59
    0
      src/main/java/PianoRoom.java
  13. 24
    0
      src/test/java/testsForEverything.java

+ 12
- 1
.idea/Ken_s_Pianos_3.iml Просмотреть файл

@@ -3,9 +3,20 @@
3 3
   <component name="NewModuleRootManager" inherit-compiler-output="true">
4 4
     <exclude-output />
5 5
     <content url="file://$MODULE_DIR$">
6
-      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
6
+      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
7
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
7 8
     </content>
8 9
     <orderEntry type="inheritedJdk" />
9 10
     <orderEntry type="sourceFolder" forTests="false" />
11
+    <orderEntry type="module-library" scope="TEST">
12
+      <library name="JUnit4">
13
+        <CLASSES>
14
+          <root url="jar://$APPLICATION_HOME_DIR$/lib/junit-4.12.jar!/" />
15
+          <root url="jar://$APPLICATION_HOME_DIR$/lib/hamcrest-core-1.3.jar!/" />
16
+        </CLASSES>
17
+        <JAVADOC />
18
+        <SOURCES />
19
+      </library>
20
+    </orderEntry>
10 21
   </component>
11 22
 </module>

+ 119
- 39
.idea/workspace.xml Просмотреть файл

@@ -2,12 +2,14 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="539361df-de15-47d4-9aa1-647d306c29f2" name="Default" comment="">
5
-      <change afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
6
-      <change afterPath="$PROJECT_DIR$/.idea/readMe.md" afterDir="false" />
7
-      <change afterPath="$PROJECT_DIR$/.idea/uiDesigner.xml" afterDir="false" />
8
-      <change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
9
-      <change afterPath="$PROJECT_DIR$/src/main/Piano.java" afterDir="false" />
10
-      <change afterPath="$PROJECT_DIR$/src/main/PianoRoom.java" afterDir="false" />
5
+      <change afterPath="$PROJECT_DIR$/src/main/java/PianoRoom.java" afterDir="false" />
6
+      <change afterPath="$PROJECT_DIR$/src/test/java/testsForEverything.java" afterDir="false" />
7
+      <change beforePath="$PROJECT_DIR$/.idea/Ken_s_Pianos_3.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/Ken_s_Pianos_3.iml" afterDir="false" />
8
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
9
+      <change beforePath="$PROJECT_DIR$/out/production/Ken_s_Pianos_3/main/Piano$SIZE.class" beforeDir="false" />
10
+      <change beforePath="$PROJECT_DIR$/out/production/Ken_s_Pianos_3/main/Piano.class" beforeDir="false" />
11
+      <change beforePath="$PROJECT_DIR$/src/main/Piano.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Piano.java" afterDir="false" />
12
+      <change beforePath="$PROJECT_DIR$/src/main/PianoRoom.java" beforeDir="false" />
11 13
     </list>
12 14
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
13 15
     <option name="TRACKING_ENABLED" value="true" />
@@ -18,35 +20,35 @@
18 20
   </component>
19 21
   <component name="FileEditorManager">
20 22
     <leaf>
21
-      <file leaf-file-name="readMe.md" pinned="false" current-in-tab="false">
22
-        <entry file="file://$PROJECT_DIR$/.idea/readMe.md">
23
-          <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
24
-            <state split_layout="SPLIT">
25
-              <first_editor relative-caret-position="15">
26
-                <caret line="1" column="14" selection-start-line="1" selection-start-column="14" selection-end-line="1" selection-end-column="14" />
27
-              </first_editor>
28
-              <second_editor />
23
+      <file leaf-file-name="Piano.java" pinned="false" current-in-tab="false">
24
+        <entry file="file://$PROJECT_DIR$/src/main/java/Piano.java">
25
+          <provider selected="true" editor-type-id="text-editor">
26
+            <state relative-caret-position="30">
27
+              <caret line="2" column="20" selection-start-line="2" selection-start-column="20" selection-end-line="2" selection-end-column="20" />
29 28
             </state>
30 29
           </provider>
31 30
         </entry>
32 31
       </file>
33
-      <file leaf-file-name="Piano.java" pinned="false" current-in-tab="true">
34
-        <entry file="file://$PROJECT_DIR$/src/main/Piano.java">
32
+      <file leaf-file-name="PianoRoom.java" pinned="false" current-in-tab="false">
33
+        <entry file="file://$PROJECT_DIR$/src/main/java/PianoRoom.java">
35 34
           <provider selected="true" editor-type-id="text-editor">
36
-            <state relative-caret-position="330">
37
-              <caret line="22" lean-forward="true" selection-start-line="22" selection-end-line="22" />
35
+            <state relative-caret-position="275">
36
+              <caret line="51" column="47" selection-start-line="51" selection-start-column="47" selection-end-line="51" selection-end-column="47" />
38 37
               <folding>
39
-                <element signature="e#109#116#0" expanded="true" />
38
+                <element signature="e#113#120#0" expanded="true" />
40 39
               </folding>
41 40
             </state>
42 41
           </provider>
43 42
         </entry>
44 43
       </file>
45
-      <file leaf-file-name="PianoRoom.java" pinned="false" current-in-tab="false">
46
-        <entry file="file://$PROJECT_DIR$/src/main/PianoRoom.java">
44
+      <file leaf-file-name="testsForEverything.java" pinned="false" current-in-tab="true">
45
+        <entry file="file://$PROJECT_DIR$/src/test/java/testsForEverything.java">
47 46
           <provider selected="true" editor-type-id="text-editor">
48
-            <state relative-caret-position="225">
49
-              <caret line="15" column="7" selection-end-line="17" />
47
+            <state relative-caret-position="295">
48
+              <caret line="20" lean-forward="true" selection-start-line="20" selection-end-line="20" />
49
+              <folding>
50
+                <element signature="imports" expanded="true" />
51
+              </folding>
50 52
             </state>
51 53
           </provider>
52 54
         </entry>
@@ -69,13 +71,16 @@
69 71
         <option value="$PROJECT_DIR$/.idea/readMe.md" />
70 72
         <option value="$PROJECT_DIR$/src/main/PianoRoom.java" />
71 73
         <option value="$PROJECT_DIR$/src/main/Piano.java" />
74
+        <option value="$PROJECT_DIR$/src/main/java/Piano.java" />
75
+        <option value="$PROJECT_DIR$/src/main/java/PianoRoom.java" />
76
+        <option value="$PROJECT_DIR$/src/test/java/testsForEverything.java" />
72 77
       </list>
73 78
     </option>
74 79
   </component>
75
-  <component name="ProjectFrameBounds">
80
+  <component name="ProjectFrameBounds" extendedState="6">
76 81
     <option name="y" value="22" />
77
-    <option name="width" value="821" />
78
-    <option name="height" value="699" />
82
+    <option name="width" value="1280" />
83
+    <option name="height" value="695" />
79 84
   </component>
80 85
   <component name="ProjectLevelVcsManager">
81 86
     <ConfirmationsSetting value="2" id="Add" />
@@ -104,6 +109,26 @@
104 109
               <item name="src" type="462c0819:PsiDirectoryNode" />
105 110
               <item name="main" type="462c0819:PsiDirectoryNode" />
106 111
             </path>
112
+            <path>
113
+              <item name="Ken_s_Pianos_3" type="b2602c69:ProjectViewProjectNode" />
114
+              <item name="Ken_s_Pianos_3" type="462c0819:PsiDirectoryNode" />
115
+              <item name="src" type="462c0819:PsiDirectoryNode" />
116
+              <item name="main" type="462c0819:PsiDirectoryNode" />
117
+              <item name="java" type="462c0819:PsiDirectoryNode" />
118
+            </path>
119
+            <path>
120
+              <item name="Ken_s_Pianos_3" type="b2602c69:ProjectViewProjectNode" />
121
+              <item name="Ken_s_Pianos_3" type="462c0819:PsiDirectoryNode" />
122
+              <item name="src" type="462c0819:PsiDirectoryNode" />
123
+              <item name="test" type="462c0819:PsiDirectoryNode" />
124
+            </path>
125
+            <path>
126
+              <item name="Ken_s_Pianos_3" type="b2602c69:ProjectViewProjectNode" />
127
+              <item name="Ken_s_Pianos_3" type="462c0819:PsiDirectoryNode" />
128
+              <item name="src" type="462c0819:PsiDirectoryNode" />
129
+              <item name="test" type="462c0819:PsiDirectoryNode" />
130
+              <item name="java" type="462c0819:PsiDirectoryNode" />
131
+            </path>
107 132
           </expand>
108 133
           <select />
109 134
         </subPane>
@@ -119,6 +144,11 @@
119 144
     <property name="project.structure.side.proportion" value="0.33547795" />
120 145
     <property name="settings.editor.selected.configurable" value="editor.preferences.import" />
121 146
   </component>
147
+  <component name="RecentsManager">
148
+    <key name="MoveFile.RECENT_KEYS">
149
+      <recent name="$PROJECT_DIR$/src/main/java" />
150
+    </key>
151
+  </component>
122 152
   <component name="RunDashboard">
123 153
     <option name="ruleStates">
124 154
       <list>
@@ -131,7 +161,7 @@
131 161
       </list>
132 162
     </option>
133 163
   </component>
134
-  <component name="RunManager" selected="Application.Piano">
164
+  <component name="RunManager" selected="JUnit.testsForEverything.testing_Piano_Creator_And_Add_To_Myrath">
135 165
     <configuration name="Piano (1)" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
136 166
       <option name="MAIN_CLASS_NAME" value="main.Piano" />
137 167
       <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
@@ -172,6 +202,23 @@
172 202
       </option>
173 203
       <patterns />
174 204
     </configuration>
205
+    <configuration name="testsForEverything.testing_Piano_Creator_And_Add_To_Myrath" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
206
+      <module name="Ken_s_Pianos_3" />
207
+      <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
208
+      <option name="ALTERNATIVE_JRE_PATH" />
209
+      <option name="PACKAGE_NAME" value="" />
210
+      <option name="MAIN_CLASS_NAME" value="testsForEverything" />
211
+      <option name="METHOD_NAME" value="testing_Piano_Creator_And_Add_To_Myrath" />
212
+      <option name="TEST_OBJECT" value="method" />
213
+      <option name="VM_PARAMETERS" value="-ea" />
214
+      <option name="PARAMETERS" />
215
+      <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
216
+      <option name="PASS_PARENT_ENVS" value="true" />
217
+      <option name="TEST_SEARCH_SCOPE">
218
+        <value defaultName="singleModule" />
219
+      </option>
220
+      <patterns />
221
+    </configuration>
175 222
     <configuration default="true" type="TestNG" factoryName="TestNG">
176 223
       <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
177 224
       <option name="ALTERNATIVE_JRE_PATH" />
@@ -197,9 +244,11 @@
197 244
     <list>
198 245
       <item itemvalue="Application.Piano" />
199 246
       <item itemvalue="Application.Piano (1)" />
247
+      <item itemvalue="JUnit.testsForEverything.testing_Piano_Creator_And_Add_To_Myrath" />
200 248
     </list>
201 249
     <recent_temporary>
202 250
       <list>
251
+        <item itemvalue="JUnit.testsForEverything.testing_Piano_Creator_And_Add_To_Myrath" />
203 252
         <item itemvalue="Application.Piano" />
204 253
         <item itemvalue="Application.Piano (1)" />
205 254
       </list>
@@ -218,23 +267,44 @@
218 267
     </task>
219 268
     <servers />
220 269
   </component>
270
+  <component name="TestHistory">
271
+    <history-entry file="testsForEverything_testing_Piano_Creator_And_Add_To_Myrath - 2018.08.06 at 15h 00m 07s.xml">
272
+      <configuration name="testsForEverything.testing_Piano_Creator_And_Add_To_Myrath" configurationId="JUnit" />
273
+    </history-entry>
274
+    <history-entry file="testsForEverything_testing_Piano_Creator_And_Add_To_Myrath - 2018.08.06 at 15h 01m 37s.xml">
275
+      <configuration name="testsForEverything.testing_Piano_Creator_And_Add_To_Myrath" configurationId="JUnit" />
276
+    </history-entry>
277
+    <history-entry file="testsForEverything_testing_Piano_Creator_And_Add_To_Myrath - 2018.08.06 at 15h 01m 52s.xml">
278
+      <configuration name="testsForEverything.testing_Piano_Creator_And_Add_To_Myrath" configurationId="JUnit" />
279
+    </history-entry>
280
+    <history-entry file="testsForEverything_testing_Piano_Creator_And_Add_To_Myrath - 2018.08.06 at 15h 02m 32s.xml">
281
+      <configuration name="testsForEverything.testing_Piano_Creator_And_Add_To_Myrath" configurationId="JUnit" />
282
+    </history-entry>
283
+    <history-entry file="testsForEverything_testing_Piano_Creator_And_Add_To_Myrath - 2018.08.06 at 15h 02m 38s.xml">
284
+      <configuration name="testsForEverything.testing_Piano_Creator_And_Add_To_Myrath" configurationId="JUnit" />
285
+    </history-entry>
286
+    <history-entry file="testsForEverything_testing_Piano_Creator_And_Add_To_Myrath - 2018.08.06 at 15h 04m 00s.xml">
287
+      <configuration name="testsForEverything.testing_Piano_Creator_And_Add_To_Myrath" configurationId="JUnit" />
288
+    </history-entry>
289
+  </component>
221 290
   <component name="ToolWindowManager">
222
-    <frame x="0" y="22" width="821" height="699" extended-state="0" />
291
+    <frame x="0" y="22" width="1280" height="699" extended-state="6" />
223 292
     <editor active="true" />
224 293
     <layout>
225 294
       <window_info anchor="right" id="Palette" />
226 295
       <window_info anchor="bottom" id="TODO" order="6" />
296
+      <window_info anchor="bottom" id="Messages" weight="0.32890365" />
227 297
       <window_info anchor="right" id="Palette&#9;" />
228 298
       <window_info id="Image Layers" />
229 299
       <window_info anchor="right" id="Capture Analysis" />
230 300
       <window_info anchor="bottom" id="Event Log" side_tool="true" />
231 301
       <window_info anchor="right" id="Maven Projects" />
232
-      <window_info anchor="bottom" id="Run" order="2" />
302
+      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.26079735" />
233 303
       <window_info anchor="bottom" id="Version Control" />
234
-      <window_info anchor="bottom" id="Terminal" />
304
+      <window_info anchor="bottom" id="Terminal" weight="0.32890365" />
235 305
       <window_info id="Capture Tool" />
236 306
       <window_info id="Designer" />
237
-      <window_info content_ui="combo" id="Project" order="0" weight="0.34087238" />
307
+      <window_info content_ui="combo" id="Project" order="0" weight="0.3401797" />
238 308
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
239 309
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
240 310
       <window_info id="UI Designer" />
@@ -259,7 +329,7 @@
259 329
     <entry file="file://$PROJECT_DIR$/.idea/modules.xml">
260 330
       <provider selected="true" editor-type-id="text-editor" />
261 331
     </entry>
262
-    <entry file="file://$PROJECT_DIR$/src/main/Piano.java">
332
+    <entry file="file://$PROJECT_DIR$/src/main/java/Piano.java">
263 333
       <provider selected="true" editor-type-id="text-editor">
264 334
         <state relative-caret-position="45">
265 335
           <caret line="3" column="4" selection-start-line="3" selection-start-column="4" selection-end-line="3" selection-end-column="4" />
@@ -286,19 +356,29 @@
286 356
         </state>
287 357
       </provider>
288 358
     </entry>
289
-    <entry file="file://$PROJECT_DIR$/src/main/PianoRoom.java">
359
+    <entry file="file://$PROJECT_DIR$/src/main/java/Piano.java">
360
+      <provider selected="true" editor-type-id="text-editor">
361
+        <state relative-caret-position="30">
362
+          <caret line="2" column="20" selection-start-line="2" selection-start-column="20" selection-end-line="2" selection-end-column="20" />
363
+        </state>
364
+      </provider>
365
+    </entry>
366
+    <entry file="file://$PROJECT_DIR$/src/main/java/PianoRoom.java">
290 367
       <provider selected="true" editor-type-id="text-editor">
291
-        <state relative-caret-position="225">
292
-          <caret line="15" column="7" selection-end-line="17" />
368
+        <state relative-caret-position="275">
369
+          <caret line="51" column="47" selection-start-line="51" selection-start-column="47" selection-end-line="51" selection-end-column="47" />
370
+          <folding>
371
+            <element signature="e#113#120#0" expanded="true" />
372
+          </folding>
293 373
         </state>
294 374
       </provider>
295 375
     </entry>
296
-    <entry file="file://$PROJECT_DIR$/src/main/Piano.java">
376
+    <entry file="file://$PROJECT_DIR$/src/test/java/testsForEverything.java">
297 377
       <provider selected="true" editor-type-id="text-editor">
298
-        <state relative-caret-position="330">
299
-          <caret line="22" lean-forward="true" selection-start-line="22" selection-end-line="22" />
378
+        <state relative-caret-position="295">
379
+          <caret line="20" lean-forward="true" selection-start-line="20" selection-end-line="20" />
300 380
           <folding>
301
-            <element signature="e#109#116#0" expanded="true" />
381
+            <element signature="imports" expanded="true" />
302 382
           </folding>
303 383
         </state>
304 384
       </provider>

Двоичные данные
out/production/Ken_s_Pianos_3/Piano$SIZE.class Просмотреть файл


Двоичные данные
out/production/Ken_s_Pianos_3/Piano.class Просмотреть файл


Двоичные данные
out/production/Ken_s_Pianos_3/PianoRoom.class Просмотреть файл


Двоичные данные
out/production/Ken_s_Pianos_3/main/Piano$SIZE.class Просмотреть файл


Двоичные данные
out/production/Ken_s_Pianos_3/main/Piano.class Просмотреть файл


Двоичные данные
out/test/Ken_s_Pianos_3/testsForEverything.class Просмотреть файл


+ 0
- 84
src/main/Piano.java Просмотреть файл

@@ -1,84 +0,0 @@
1
-package main;
2
-
3
-import java.util.ArrayList;
4
-
5
-public class Piano {
6
-
7
-    static ArrayList<Piano> Myrath = new ArrayList<Piano>();
8
-
9
-
10
-    private static enum SIZE {SIXTY_ONE, EIGHTY_FOUR, ONEHUNDRED_TWENTY_EIGHT, TWOHUNDRED, THREEHUNDRED};
11
-
12
-    private static SIZE size;
13
-
14
-
15
-    public static void main(String[] args) {
16
-
17
-        pianoCreator();
18
-
19
-        System.out.println(Myrath);
20
-    }
21
-
22
-
23
-
24
-
25
-
26
-
27
-    public Piano(){
28
-
29
-    }
30
-
31
-
32
-//    public Piano(SIZE x){
33
-//
34
-//    }
35
-
36
-
37
-
38
-
39
-    public static SIZE getSIZE(Piano x){
40
-        return x.size;
41
-    }
42
-
43
-    public static void setSIZE(SIZE r){
44
-        size = r;
45
-    }
46
-
47
-
48
-    public static Piano pianoCreator(){
49
-        int decider = (int) Math.round(Math.random() * 5);
50
-
51
-        switch(decider){
52
-            case 1:
53
-                size = SIZE.SIXTY_ONE;
54
-                break;
55
-
56
-            case 2:
57
-                size = SIZE.EIGHTY_FOUR;
58
-                break;
59
-
60
-            case 3:
61
-                size = SIZE.ONEHUNDRED_TWENTY_EIGHT;
62
-                break;
63
-
64
-            case 4:
65
-                size = SIZE.TWOHUNDRED;
66
-                break;
67
-
68
-            case 5:
69
-                size = SIZE.THREEHUNDRED;
70
-                break;
71
-        }
72
-
73
-        Piano newPiano = new Piano();
74
-        newPiano.setSIZE(size);
75
-        addingToMyrath(newPiano);
76
-
77
-//        return new Piano().setSIZE(size);
78
-        return newPiano;
79
-    }
80
-
81
-    public static boolean addingToMyrath(Piano x){
82
-        return Myrath.add(x);
83
-    }
84
-}

+ 0
- 17
src/main/PianoRoom.java Просмотреть файл

@@ -1,17 +0,0 @@
1
-//package main;
2
-//
3
-//import java.util.ArrayList;
4
-//
5
-//public class PianoRoom {
6
-//
7
-//    ArrayList<Piano> Myrath = new ArrayList<Piano>();
8
-//
9
-//    public static void main(String[] args) {
10
-//
11
-//    }
12
-//
13
-//
14
-//    public void fillMyrath(){
15
-//        Piano
16
-//    }
17
-//}

+ 25
- 0
src/main/java/Piano.java Просмотреть файл

@@ -0,0 +1,25 @@
1
+import java.util.ArrayList;
2
+
3
+public class Piano {
4
+
5
+    enum SIZE {SIXTY_ONE, EIGHTY_FOUR, ONEHUNDRED_TWENTY_EIGHT, TWOHUNDRED, THREEHUNDRED};
6
+
7
+    public SIZE size;
8
+
9
+    public Piano(){
10
+
11
+    }
12
+
13
+//    public Piano(SIZE x){
14
+//
15
+//    }
16
+
17
+    public SIZE getSIZE(Piano x){
18
+        return x.size;
19
+    }
20
+
21
+    public void setSIZE(SIZE r){
22
+        size = r;
23
+    }
24
+
25
+}

+ 59
- 0
src/main/java/PianoRoom.java Просмотреть файл

@@ -0,0 +1,59 @@
1
+import java.util.ArrayList;
2
+
3
+public class PianoRoom {
4
+
5
+    Piano piano = new Piano();
6
+
7
+    ArrayList<Piano> Myrath = new ArrayList<Piano>();
8
+
9
+    public static void main(String[] args) {
10
+
11
+    }
12
+
13
+    public Piano pianoCreator(){
14
+        Piano newPiano = new Piano();
15
+
16
+        int decider = (int) Math.round(Math.random() * 5);
17
+
18
+        switch(decider){
19
+            case 1:
20
+                newPiano.setSIZE(Piano.SIZE.SIXTY_ONE);
21
+                break;
22
+
23
+            case 2:
24
+                newPiano.setSIZE(Piano.SIZE.EIGHTY_FOUR);
25
+                break;
26
+
27
+            case 3:
28
+                newPiano.setSIZE(Piano.SIZE.ONEHUNDRED_TWENTY_EIGHT);
29
+                break;
30
+
31
+            case 4:
32
+                newPiano.setSIZE(Piano.SIZE.TWOHUNDRED);
33
+                break;
34
+
35
+            case 5:
36
+                newPiano.setSIZE(Piano.SIZE.THREEHUNDRED);
37
+                break;
38
+        }
39
+
40
+        addingToMyrath(newPiano);
41
+
42
+        return newPiano;
43
+    }
44
+
45
+
46
+    public boolean addingToMyrath(Piano x){
47
+        return Myrath.add(x);
48
+    }
49
+
50
+
51
+    public void howManyTimes(int x){
52
+        x = (int) Math.round(Math.random() * 50);
53
+        int q = 0;
54
+        while(q <= x){
55
+            pianoCreator();
56
+            q++;
57
+        }
58
+    }
59
+}

+ 24
- 0
src/test/java/testsForEverything.java Просмотреть файл

@@ -0,0 +1,24 @@
1
+//import org.junit.Assert;
2
+//import org.junit.Test;
3
+//
4
+//public class testsForEverything {
5
+//
6
+//    PianoRoom pianoRoom = new PianoRoom();
7
+//    Piano piano = new Piano();
8
+//
9
+//    @Test
10
+//    public void testing_Piano_Creator_And_Add_To_Myrath(){
11
+//
12
+////        pianoRoom.pianoCreator();
13
+////        Assert.assertTrue(pianoRoom.Myrath.size() > 0);
14
+//
15
+//        pianoRoom.howManyTimes(5);
16
+//        Assert.assertTrue(pianoRoom.Myrath.size() > 0);
17
+//        for(Piano x : pianoRoom.Myrath){
18
+//            System.out.println(x);
19
+//        }
20
+//    }
21
+//
22
+//
23
+//
24
+//}