Browse Source

Classes written, tests run and passed

Lauren Green 6 years ago
parent
commit
1b0c156ff9

+ 158
- 147
.idea/workspace.xml View File

@@ -2,14 +2,9 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="268ab437-e0d5-4447-8401-9f321aad6d50" name="Default" comment="">
5
-      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__junit_junit_4_12.xml" afterDir="false" />
6
-      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml" afterDir="false" />
7
-      <change afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Inventory.java" afterDir="false" />
8
-      <change beforePath="$PROJECT_DIR$/.idea/compiler.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
9
-      <change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
10
-      <change beforePath="$PROJECT_DIR$/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
5
+      <change afterPath="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/InventoryTest.java" afterDir="false" />
11 6
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
12
-      <change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
7
+      <change beforePath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Inventory.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Inventory.java" afterDir="false" />
13 8
       <change beforePath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/MainApplication.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/MainApplication.java" afterDir="false" />
14 9
       <change beforePath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Product.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Product.java" afterDir="false" />
15 10
       <change beforePath="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/ProductTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/ProductTest.java" afterDir="false" />
@@ -23,42 +18,49 @@
23 18
     <option name="LAST_RESOLUTION" value="IGNORE" />
24 19
   </component>
25 20
   <component name="CoverageDataManager">
26
-    <SUITE FILE_PATH="coverage/CR_MesoLabs_Inheritance_ProductManager$ProductTest.ic" NAME="ProductTest Coverage Results" MODIFIED="1540396416717" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false">
21
+    <SUITE FILE_PATH="coverage/CR_MesoLabs_Inheritance_ProductManager$InventoryTest.ic" NAME="InventoryTest Coverage Results" MODIFIED="1540416798335" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false">
27 22
       <FILTER>com.zipcodewilmington.productmanager.*</FILTER>
28 23
     </SUITE>
24
+    <SUITE FILE_PATH="coverage/CR_MesoLabs_Inheritance_ProductManager$ProductTest.ic" NAME="ProductTest Coverage Results" MODIFIED="1540416814488" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="idea" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false">
25
+      <FILTER>com.zipcodewilmington.productmanager.*</FILTER>
26
+    </SUITE>
27
+  </component>
28
+  <component name="CoverageViewManager">
29
+    <option name="myElementSize" value="214" />
29 30
   </component>
30 31
   <component name="FUSProjectUsageTrigger">
31 32
     <session id="-226491811">
32 33
       <usages-collector id="statistics.lifecycle.project">
33 34
         <counts>
34
-          <entry key="project.closed" value="1" />
35
+          <entry key="project.closed" value="2" />
35 36
           <entry key="project.open.time.11" value="1" />
37
+          <entry key="project.open.time.26" value="1" />
36 38
           <entry key="project.open.time.5" value="1" />
37
-          <entry key="project.opened" value="2" />
39
+          <entry key="project.opened" value="3" />
38 40
         </counts>
39 41
       </usages-collector>
40 42
       <usages-collector id="statistics.file.extensions.edit">
41 43
         <counts>
42
-          <entry key="java" value="820" />
44
+          <entry key="java" value="4069" />
43 45
           <entry key="xml" value="1" />
44 46
         </counts>
45 47
       </usages-collector>
46 48
       <usages-collector id="statistics.file.types.edit">
47 49
         <counts>
48
-          <entry key="JAVA" value="820" />
50
+          <entry key="JAVA" value="4069" />
49 51
           <entry key="XML" value="1" />
50 52
         </counts>
51 53
       </usages-collector>
52 54
       <usages-collector id="statistics.file.extensions.open">
53 55
         <counts>
54 56
           <entry key="Inventory" value="1" />
55
-          <entry key="java" value="1" />
57
+          <entry key="java" value="3" />
56 58
         </counts>
57 59
       </usages-collector>
58 60
       <usages-collector id="statistics.file.types.open">
59 61
         <counts>
60 62
           <entry key="CLASS" value="1" />
61
-          <entry key="JAVA" value="1" />
63
+          <entry key="JAVA" value="3" />
62 64
         </counts>
63 65
       </usages-collector>
64 66
     </session>
@@ -74,11 +76,11 @@
74 76
           </provider>
75 77
         </entry>
76 78
       </file>
77
-      <file pinned="false" current-in-tab="false">
79
+      <file pinned="false" current-in-tab="true">
78 80
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/MainApplication.java">
79 81
           <provider selected="true" editor-type-id="text-editor">
80
-            <state relative-caret-position="120">
81
-              <caret line="8" selection-start-line="8" selection-end-line="8" />
82
+            <state relative-caret-position="825">
83
+              <caret line="55" lean-forward="true" selection-start-line="55" selection-end-line="55" />
82 84
             </state>
83 85
           </provider>
84 86
         </entry>
@@ -86,29 +88,23 @@
86 88
       <file pinned="false" current-in-tab="false">
87 89
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Product.java">
88 90
           <provider selected="true" editor-type-id="text-editor">
89
-            <state relative-caret-position="540">
90
-              <caret line="36" selection-start-line="36" selection-end-line="36" />
91
+            <state>
92
+              <caret column="45" lean-forward="true" selection-start-column="45" selection-end-column="45" />
91 93
               <folding>
92
-                <element signature="e#366#367#0" expanded="true" />
93
-                <element signature="e#394#395#0" expanded="true" />
94
-                <element signature="e#436#437#0" expanded="true" />
95
-                <element signature="e#470#471#0" expanded="true" />
96
-                <element signature="e#502#503#0" expanded="true" />
97
-                <element signature="e#533#534#0" expanded="true" />
98
-                <element signature="e#578#579#0" expanded="true" />
99
-                <element signature="e#618#619#0" expanded="true" />
100
-                <element signature="e#652#653#0" expanded="true" />
101 94
                 <element signature="e#677#678#0" expanded="true" />
95
+                <element signature="e#711#712#0" expanded="true" />
96
+                <element signature="e#893#894#0" expanded="true" />
97
+                <element signature="e#918#919#0" expanded="true" />
102 98
               </folding>
103 99
             </state>
104 100
           </provider>
105 101
         </entry>
106 102
       </file>
107
-      <file pinned="false" current-in-tab="true">
103
+      <file pinned="false" current-in-tab="false">
108 104
         <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/ProductTest.java">
109 105
           <provider selected="true" editor-type-id="text-editor">
110
-            <state relative-caret-position="1080">
111
-              <caret line="72" column="11" selection-start-line="72" selection-start-column="11" selection-end-line="72" selection-end-column="11" />
106
+            <state relative-caret-position="-77">
107
+              <caret line="17" column="8" selection-start-line="17" selection-start-column="8" selection-end-line="17" selection-end-column="32" />
112 108
               <folding>
113 109
                 <element signature="imports" expanded="true" />
114 110
               </folding>
@@ -119,8 +115,25 @@
119 115
       <file pinned="false" current-in-tab="false">
120 116
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Inventory.java">
121 117
           <provider selected="true" editor-type-id="text-editor">
122
-            <state relative-caret-position="90">
123
-              <caret line="6" selection-start-line="6" selection-end-line="6" />
118
+            <state>
119
+              <caret column="16" lean-forward="true" selection-start-column="16" selection-end-column="16" />
120
+              <folding>
121
+                <element signature="imports" expanded="true" />
122
+              </folding>
123
+            </state>
124
+          </provider>
125
+        </entry>
126
+      </file>
127
+      <file pinned="false" current-in-tab="false">
128
+        <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/InventoryTest.java">
129
+          <provider selected="true" editor-type-id="text-editor">
130
+            <state relative-caret-position="815">
131
+              <caret line="76" column="36" selection-start-line="76" selection-start-column="36" selection-end-line="76" selection-end-column="36" />
132
+              <folding>
133
+                <element signature="imports" expanded="true" />
134
+                <element signature="e#1332#1340#0" expanded="true" />
135
+                <element signature="e#1387#1395#0" expanded="true" />
136
+              </folding>
124 137
             </state>
125 138
           </provider>
126 139
         </entry>
@@ -163,11 +176,12 @@
163 176
       <list>
164 177
         <option value="$PROJECT_DIR$/.gitignore" />
165 178
         <option value="$PROJECT_DIR$/README.md" />
166
-        <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/MainApplication.java" />
167 179
         <option value="$PROJECT_DIR$/pom.xml" />
180
+        <option value="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/ProductTest.java" />
168 181
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Inventory.java" />
182
+        <option value="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/InventoryTest.java" />
169 183
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Product.java" />
170
-        <option value="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/ProductTest.java" />
184
+        <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/MainApplication.java" />
171 185
       </list>
172 186
     </option>
173 187
   </component>
@@ -185,54 +199,22 @@
185 199
     </option>
186 200
   </component>
187 201
   <component name="ProjectFrameBounds">
188
-    <option name="x" value="218" />
202
+    <option name="x" value="168" />
189 203
     <option name="y" value="23" />
190
-    <option name="width" value="1310" />
191
-    <option name="height" value="959" />
204
+    <option name="width" value="1395" />
205
+    <option name="height" value="950" />
192 206
   </component>
193 207
   <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
194 208
   <component name="ProjectView">
195 209
     <navigator proportions="" version="1">
196 210
       <foldersAlwaysOnTop value="true" />
197 211
     </navigator>
198
-    <panes>
199
-      <pane id="ProjectPane">
200
-        <subPane>
201
-          <expand>
202
-            <path>
203
-              <item name="CR-MesoLabs-Inheritance-ProductManager" type="b2602c69:ProjectViewProjectNode" />
204
-              <item name="CR-MesoLabs-Inheritance-ProductManager" type="462c0819:PsiDirectoryNode" />
205
-            </path>
206
-            <path>
207
-              <item name="CR-MesoLabs-Inheritance-ProductManager" type="b2602c69:ProjectViewProjectNode" />
208
-              <item name="CR-MesoLabs-Inheritance-ProductManager" type="462c0819:PsiDirectoryNode" />
209
-              <item name="src" type="462c0819:PsiDirectoryNode" />
210
-            </path>
211
-            <path>
212
-              <item name="CR-MesoLabs-Inheritance-ProductManager" type="b2602c69:ProjectViewProjectNode" />
213
-              <item name="CR-MesoLabs-Inheritance-ProductManager" type="462c0819:PsiDirectoryNode" />
214
-              <item name="src" type="462c0819:PsiDirectoryNode" />
215
-              <item name="main" type="462c0819:PsiDirectoryNode" />
216
-            </path>
217
-            <path>
218
-              <item name="CR-MesoLabs-Inheritance-ProductManager" type="b2602c69:ProjectViewProjectNode" />
219
-              <item name="CR-MesoLabs-Inheritance-ProductManager" type="462c0819:PsiDirectoryNode" />
220
-              <item name="src" type="462c0819:PsiDirectoryNode" />
221
-              <item name="main" type="462c0819:PsiDirectoryNode" />
222
-              <item name="java" type="462c0819:PsiDirectoryNode" />
223
-            </path>
224
-          </expand>
225
-          <select />
226
-        </subPane>
227
-      </pane>
228
-      <pane id="Scope" />
229
-      <pane id="PackagesPane" />
230
-    </panes>
212
+    <panes />
231 213
   </component>
232 214
   <component name="PropertiesComponent">
233 215
     <property name="WebServerToolWindowFactoryState" value="false" />
234 216
     <property name="aspect.path.notification.shown" value="true" />
235
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1540396437131" />
217
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1540418869862" />
236 218
     <property name="project.structure.last.edited" value="Project" />
237 219
     <property name="project.structure.proportion" value="0.0" />
238 220
     <property name="project.structure.side.proportion" value="0.2" />
@@ -250,7 +232,7 @@
250 232
       </list>
251 233
     </option>
252 234
   </component>
253
-  <component name="RunManager" selected="JUnit.ProductTest">
235
+  <component name="RunManager" selected="Application.MainApplication">
254 236
     <configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
255 237
       <module name="" />
256 238
       <option name="TESTING_TYPE" value="0" />
@@ -297,13 +279,27 @@
297 279
         <option name="Make" enabled="true" />
298 280
       </method>
299 281
     </configuration>
282
+    <configuration name="MainApplication" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
283
+      <option name="MAIN_CLASS_NAME" value="com.zipcodewilmington.productmanager.MainApplication" />
284
+      <module name="CR-MesoLabs-Inheritance-ProductManager" />
285
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
286
+      <extension name="coverage">
287
+        <pattern>
288
+          <option name="PATTERN" value="com.zipcodewilmington.productmanager.*" />
289
+          <option name="ENABLED" value="true" />
290
+        </pattern>
291
+      </extension>
292
+      <method v="2">
293
+        <option name="Make" enabled="true" />
294
+      </method>
295
+    </configuration>
300 296
     <configuration default="true" type="Application" factoryName="Application">
301 297
       <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
302 298
       <method v="2">
303 299
         <option name="Make" enabled="true" />
304 300
       </method>
305 301
     </configuration>
306
-    <configuration name="ProductTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
302
+    <configuration name="InventoryTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
307 303
       <module name="CR-MesoLabs-Inheritance-ProductManager" />
308 304
       <extension name="coverage">
309 305
         <pattern>
@@ -312,13 +308,13 @@
312 308
         </pattern>
313 309
       </extension>
314 310
       <option name="PACKAGE_NAME" value="com.zipcodewilmington.productmanager" />
315
-      <option name="MAIN_CLASS_NAME" value="com.zipcodewilmington.productmanager.ProductTest" />
311
+      <option name="MAIN_CLASS_NAME" value="com.zipcodewilmington.productmanager.InventoryTest" />
316 312
       <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
317 313
       <method v="2">
318 314
         <option name="Make" enabled="true" />
319 315
       </method>
320 316
     </configuration>
321
-    <configuration name="ProductTest.testProductConstructor" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
317
+    <configuration name="InventoryTest.testGetInvValue" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
322 318
       <module name="CR-MesoLabs-Inheritance-ProductManager" />
323 319
       <extension name="coverage">
324 320
         <pattern>
@@ -327,15 +323,15 @@
327 323
         </pattern>
328 324
       </extension>
329 325
       <option name="PACKAGE_NAME" value="com.zipcodewilmington.productmanager" />
330
-      <option name="MAIN_CLASS_NAME" value="com.zipcodewilmington.productmanager.ProductTest" />
331
-      <option name="METHOD_NAME" value="testProductConstructor" />
326
+      <option name="MAIN_CLASS_NAME" value="com.zipcodewilmington.productmanager.InventoryTest" />
327
+      <option name="METHOD_NAME" value="testGetInvValue" />
332 328
       <option name="TEST_OBJECT" value="method" />
333 329
       <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
334 330
       <method v="2">
335 331
         <option name="Make" enabled="true" />
336 332
       </method>
337 333
     </configuration>
338
-    <configuration name="ProductTest.testSetPrice" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
334
+    <configuration name="InventoryTest.testGetListOfValues" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
339 335
       <module name="CR-MesoLabs-Inheritance-ProductManager" />
340 336
       <extension name="coverage">
341 337
         <pattern>
@@ -344,15 +340,15 @@
344 340
         </pattern>
345 341
       </extension>
346 342
       <option name="PACKAGE_NAME" value="com.zipcodewilmington.productmanager" />
347
-      <option name="MAIN_CLASS_NAME" value="com.zipcodewilmington.productmanager.ProductTest" />
348
-      <option name="METHOD_NAME" value="testSetPrice" />
343
+      <option name="MAIN_CLASS_NAME" value="com.zipcodewilmington.productmanager.InventoryTest" />
344
+      <option name="METHOD_NAME" value="testGetListOfValues" />
349 345
       <option name="TEST_OBJECT" value="method" />
350 346
       <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
351 347
       <method v="2">
352 348
         <option name="Make" enabled="true" />
353 349
       </method>
354 350
     </configuration>
355
-    <configuration name="ProductTest.testSetQuantity" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
351
+    <configuration name="ProductTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
356 352
       <module name="CR-MesoLabs-Inheritance-ProductManager" />
357 353
       <extension name="coverage">
358 354
         <pattern>
@@ -362,8 +358,6 @@
362 358
       </extension>
363 359
       <option name="PACKAGE_NAME" value="com.zipcodewilmington.productmanager" />
364 360
       <option name="MAIN_CLASS_NAME" value="com.zipcodewilmington.productmanager.ProductTest" />
365
-      <option name="METHOD_NAME" value="testSetQuantity" />
366
-      <option name="TEST_OBJECT" value="method" />
367 361
       <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
368 362
       <method v="2">
369 363
         <option name="Make" enabled="true" />
@@ -406,17 +400,19 @@
406 400
       </method>
407 401
     </configuration>
408 402
     <list>
409
-      <item itemvalue="JUnit.ProductTest.testProductConstructor" />
403
+      <item itemvalue="JUnit.InventoryTest.testGetInvValue" />
404
+      <item itemvalue="JUnit.InventoryTest" />
405
+      <item itemvalue="JUnit.InventoryTest.testGetListOfValues" />
410 406
       <item itemvalue="JUnit.ProductTest" />
411
-      <item itemvalue="JUnit.ProductTest.testSetPrice" />
412
-      <item itemvalue="JUnit.ProductTest.testSetQuantity" />
407
+      <item itemvalue="Application.MainApplication" />
413 408
     </list>
414 409
     <recent_temporary>
415 410
       <list>
411
+        <item itemvalue="Application.MainApplication" />
412
+        <item itemvalue="JUnit.InventoryTest.testGetInvValue" />
413
+        <item itemvalue="JUnit.InventoryTest.testGetListOfValues" />
416 414
         <item itemvalue="JUnit.ProductTest" />
417
-        <item itemvalue="JUnit.ProductTest.testSetQuantity" />
418
-        <item itemvalue="JUnit.ProductTest.testSetPrice" />
419
-        <item itemvalue="JUnit.ProductTest.testProductConstructor" />
415
+        <item itemvalue="JUnit.InventoryTest" />
420 416
       </list>
421 417
     </recent_temporary>
422 418
   </component>
@@ -431,50 +427,51 @@
431 427
       <option name="presentableId" value="Default" />
432 428
       <updated>1515620835041</updated>
433 429
       <workItem from="1540391133925" duration="661000" />
434
-      <workItem from="1540393564385" duration="2867000" />
430
+      <workItem from="1540393564385" duration="10735000" />
431
+      <workItem from="1540414522906" duration="4331000" />
435 432
     </task>
436 433
     <servers />
437 434
   </component>
438 435
   <component name="TestHistory">
439
-    <history-entry file="ProductTest_testProductConstructor - 2018.10.24 at 11h 35m 21s.xml">
440
-      <configuration name="ProductTest.testProductConstructor" configurationId="JUnit" />
436
+    <history-entry file="InventoryTest - 2018.10.24 at 17h 11m 34s.xml">
437
+      <configuration name="InventoryTest" configurationId="JUnit" />
441 438
     </history-entry>
442
-    <history-entry file="ProductTest_testProductConstructor - 2018.10.24 at 11h 36m 26s.xml">
443
-      <configuration name="ProductTest.testProductConstructor" configurationId="JUnit" />
439
+    <history-entry file="InventoryTest_testGetInvValue - 2018.10.24 at 17h 22m 03s.xml">
440
+      <configuration name="InventoryTest.testGetInvValue" configurationId="JUnit" />
444 441
     </history-entry>
445
-    <history-entry file="ProductTest_testProductConstructor - 2018.10.24 at 11h 36m 51s.xml">
446
-      <configuration name="ProductTest.testProductConstructor" configurationId="JUnit" />
442
+    <history-entry file="InventoryTest_testGetListOfValues - 2018.10.24 at 17h 29m 01s.xml">
443
+      <configuration name="InventoryTest.testGetListOfValues" configurationId="JUnit" />
447 444
     </history-entry>
448
-    <history-entry file="ProductTest - 2018.10.24 at 11h 38m 15s.xml">
449
-      <configuration name="ProductTest" configurationId="JUnit" />
445
+    <history-entry file="InventoryTest_testGetInvValue - 2018.10.24 at 17h 30m 15s.xml">
446
+      <configuration name="InventoryTest.testGetInvValue" configurationId="JUnit" />
450 447
     </history-entry>
451
-    <history-entry file="ProductTest - 2018.10.24 at 11h 45m 17s.xml">
452
-      <configuration name="ProductTest" configurationId="JUnit" />
448
+    <history-entry file="InventoryTest_testGetInvValue - 2018.10.24 at 17h 32m 17s.xml">
449
+      <configuration name="InventoryTest.testGetInvValue" configurationId="JUnit" />
453 450
     </history-entry>
454
-    <history-entry file="ProductTest - 2018.10.24 at 11h 48m 44s.xml">
455
-      <configuration name="ProductTest" configurationId="JUnit" />
451
+    <history-entry file="InventoryTest - 2018.10.24 at 17h 32m 32s.xml">
452
+      <configuration name="InventoryTest" configurationId="JUnit" />
456 453
     </history-entry>
457
-    <history-entry file="ProductTest - 2018.10.24 at 11h 49m 06s.xml">
458
-      <configuration name="ProductTest" configurationId="JUnit" />
454
+    <history-entry file="InventoryTest - 2018.10.24 at 17h 33m 20s.xml">
455
+      <configuration name="InventoryTest" configurationId="JUnit" />
459 456
     </history-entry>
460
-    <history-entry file="ProductTest_testSetPrice - 2018.10.24 at 11h 52m 14s.xml">
461
-      <configuration name="ProductTest.testSetPrice" configurationId="JUnit" />
457
+    <history-entry file="ProductTest - 2018.10.24 at 17h 33m 36s.xml">
458
+      <configuration name="ProductTest" configurationId="JUnit" />
462 459
     </history-entry>
463
-    <history-entry file="ProductTest_testSetQuantity - 2018.10.24 at 11h 53m 26s.xml">
464
-      <configuration name="ProductTest.testSetQuantity" configurationId="JUnit" />
460
+    <history-entry file="InventoryTest_testGetListOfValues - 2018.10.24 at 17h 34m 18s.xml">
461
+      <configuration name="InventoryTest.testGetListOfValues" configurationId="JUnit" />
465 462
     </history-entry>
466
-    <history-entry file="ProductTest - 2018.10.24 at 11h 53m 39s.xml">
467
-      <configuration name="ProductTest" configurationId="JUnit" />
463
+    <history-entry file="InventoryTest_testGetInvValue - 2018.10.24 at 17h 34m 32s.xml">
464
+      <configuration name="InventoryTest.testGetInvValue" configurationId="JUnit" />
468 465
     </history-entry>
469 466
   </component>
470 467
   <component name="TimeTrackingManager">
471
-    <option name="totallyTimeSpent" value="3528000" />
468
+    <option name="totallyTimeSpent" value="15727000" />
472 469
   </component>
473 470
   <component name="ToolWindowManager">
474
-    <frame x="218" y="23" width="1310" height="959" extended-state="0" />
471
+    <frame x="168" y="23" width="1395" height="950" extended-state="0" />
475 472
     <editor active="true" />
476 473
     <layout>
477
-      <window_info content_ui="combo" id="Project" order="0" weight="0.25579977" />
474
+      <window_info content_ui="combo" id="Project" order="0" weight="0.2555205" />
478 475
       <window_info id="Structure" order="1" weight="0.25" />
479 476
       <window_info id="Nl-Palette" order="2" />
480 477
       <window_info id="Favorites" order="3" side_tool="true" />
@@ -482,10 +479,9 @@
482 479
       <window_info id="Designer" order="5" />
483 480
       <window_info id="UI Designer" order="6" />
484 481
       <window_info id="Capture Tool" order="7" />
485
-      <window_info anchor="bottom" id="Messages" weight="0.3298731" />
486 482
       <window_info anchor="bottom" id="Message" order="0" />
487 483
       <window_info anchor="bottom" id="Find" order="1" />
488
-      <window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.3298731" />
484
+      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.23659673" />
489 485
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
490 486
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
491 487
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
@@ -494,7 +490,7 @@
494 490
       <window_info anchor="bottom" id="Event Log" order="8" side_tool="true" />
495 491
       <window_info anchor="bottom" id="Version Control" order="9" />
496 492
       <window_info anchor="bottom" id="Database Changes" order="10" show_stripe_button="false" />
497
-      <window_info active="true" anchor="right" id="Coverage" side_tool="true" visible="true" weight="0.329653" />
493
+      <window_info anchor="bottom" id="Messages" order="11" weight="0.32867134" />
498 494
       <window_info anchor="right" id="Commander" order="0" weight="0.4" />
499 495
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
500 496
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
@@ -505,6 +501,7 @@
505 501
       <window_info anchor="right" id="Palette&#9;" order="7" />
506 502
       <window_info anchor="right" id="Maven Projects" order="8" />
507 503
       <window_info anchor="right" id="Database" order="9" />
504
+      <window_info anchor="right" id="Coverage" order="10" side_tool="true" weight="0.32875606" />
508 505
     </layout>
509 506
   </component>
510 507
   <component name="TypeScriptGeneratedFilesManager">
@@ -514,6 +511,21 @@
514 511
     <option name="myLimit" value="2678400000" />
515 512
   </component>
516 513
   <component name="editorHistoryManager">
514
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Inventory" />
515
+    <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/src.zip!/java/util/ArrayList.java">
516
+      <provider selected="true" editor-type-id="text-editor">
517
+        <state relative-caret-position="-2149">
518
+          <caret line="460" column="19" selection-start-line="460" selection-start-column="19" selection-end-line="460" selection-end-column="19" />
519
+        </state>
520
+      </provider>
521
+    </entry>
522
+    <entry file="file://$PROJECT_DIR$/pom.xml">
523
+      <provider selected="true" editor-type-id="text-editor">
524
+        <state relative-caret-position="270">
525
+          <caret line="18" column="19" selection-start-line="18" selection-start-column="19" selection-end-line="18" selection-end-column="19" />
526
+        </state>
527
+      </provider>
528
+    </entry>
517 529
     <entry file="file://$PROJECT_DIR$/.gitignore">
518 530
       <provider selected="true" editor-type-id="text-editor">
519 531
         <state relative-caret-position="90">
@@ -531,58 +543,57 @@
531 543
         </state>
532 544
       </provider>
533 545
     </entry>
534
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Inventory">
535
-      <provider selected="true" editor-type-id="text-editor" />
536
-    </entry>
537
-    <entry file="file://$PROJECT_DIR$/pom.xml">
538
-      <provider selected="true" editor-type-id="text-editor">
539
-        <state relative-caret-position="270">
540
-          <caret line="18" column="19" selection-start-line="18" selection-start-column="19" selection-end-line="18" selection-end-column="19" />
541
-        </state>
542
-      </provider>
543
-    </entry>
544
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/MainApplication.java">
546
+    <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/InventoryTest.java">
545 547
       <provider selected="true" editor-type-id="text-editor">
546
-        <state relative-caret-position="120">
547
-          <caret line="8" selection-start-line="8" selection-end-line="8" />
548
+        <state relative-caret-position="815">
549
+          <caret line="76" column="36" selection-start-line="76" selection-start-column="36" selection-end-line="76" selection-end-column="36" />
550
+          <folding>
551
+            <element signature="imports" expanded="true" />
552
+            <element signature="e#1332#1340#0" expanded="true" />
553
+            <element signature="e#1387#1395#0" expanded="true" />
554
+          </folding>
548 555
         </state>
549 556
       </provider>
550 557
     </entry>
551
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Inventory.java">
558
+    <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/ProductTest.java">
552 559
       <provider selected="true" editor-type-id="text-editor">
553
-        <state relative-caret-position="90">
554
-          <caret line="6" selection-start-line="6" selection-end-line="6" />
560
+        <state relative-caret-position="-77">
561
+          <caret line="17" column="8" selection-start-line="17" selection-start-column="8" selection-end-line="17" selection-end-column="32" />
562
+          <folding>
563
+            <element signature="imports" expanded="true" />
564
+          </folding>
555 565
         </state>
556 566
       </provider>
557 567
     </entry>
558 568
     <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Product.java">
559 569
       <provider selected="true" editor-type-id="text-editor">
560
-        <state relative-caret-position="540">
561
-          <caret line="36" selection-start-line="36" selection-end-line="36" />
570
+        <state>
571
+          <caret column="45" lean-forward="true" selection-start-column="45" selection-end-column="45" />
562 572
           <folding>
563
-            <element signature="e#366#367#0" expanded="true" />
564
-            <element signature="e#394#395#0" expanded="true" />
565
-            <element signature="e#436#437#0" expanded="true" />
566
-            <element signature="e#470#471#0" expanded="true" />
567
-            <element signature="e#502#503#0" expanded="true" />
568
-            <element signature="e#533#534#0" expanded="true" />
569
-            <element signature="e#578#579#0" expanded="true" />
570
-            <element signature="e#618#619#0" expanded="true" />
571
-            <element signature="e#652#653#0" expanded="true" />
572 573
             <element signature="e#677#678#0" expanded="true" />
574
+            <element signature="e#711#712#0" expanded="true" />
575
+            <element signature="e#893#894#0" expanded="true" />
576
+            <element signature="e#918#919#0" expanded="true" />
573 577
           </folding>
574 578
         </state>
575 579
       </provider>
576 580
     </entry>
577
-    <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/ProductTest.java">
581
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Inventory.java">
578 582
       <provider selected="true" editor-type-id="text-editor">
579
-        <state relative-caret-position="1080">
580
-          <caret line="72" column="11" selection-start-line="72" selection-start-column="11" selection-end-line="72" selection-end-column="11" />
583
+        <state>
584
+          <caret column="16" lean-forward="true" selection-start-column="16" selection-end-column="16" />
581 585
           <folding>
582 586
             <element signature="imports" expanded="true" />
583 587
           </folding>
584 588
         </state>
585 589
       </provider>
586 590
     </entry>
591
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/MainApplication.java">
592
+      <provider selected="true" editor-type-id="text-editor">
593
+        <state relative-caret-position="825">
594
+          <caret line="55" lean-forward="true" selection-start-line="55" selection-end-line="55" />
595
+        </state>
596
+      </provider>
597
+    </entry>
587 598
   </component>
588 599
 </project>

+ 48
- 0
src/main/java/com/zipcodewilmington/productmanager/Inventory.java View File

@@ -1,8 +1,56 @@
1 1
 package com.zipcodewilmington.productmanager;
2 2
 
3 3
 
4
+import java.lang.reflect.Array;
5
+import java.util.ArrayList;
6
+
4 7
 public class Inventory {
5 8
 
9
+    private ArrayList<Product> productList;
10
+    private double inventoryValue = 0.00;
11
+
12
+    public Inventory() {
13
+        this.productList = new ArrayList<Product>(Product.getProductList());
14
+        this.inventoryValue = calcInventoryValue(getListOfValues());
15
+
16
+    }
17
+
18
+    public double getInventoryValue() {
19
+
20
+        return this.inventoryValue;
21
+
22
+    }
23
+
24
+    public ArrayList<Product> getProductList() {
25
+
26
+        return this.productList;
27
+
28
+    }
29
+
30
+    public ArrayList<Double> getListOfValues() {
31
+
32
+        ArrayList<Double> listOfValues = new ArrayList<Double>();
33
+
34
+        for (Product item : this.productList) {
35
+            listOfValues.add(item.getValue());
36
+        }
37
+
38
+        return listOfValues;
39
+
40
+    }
41
+
42
+    public double calcInventoryValue(ArrayList<Double> values) {
43
+
44
+        double inventoryValue = 0.00;
45
+
46
+        for (double val : values) {
47
+
48
+            inventoryValue = inventoryValue + val;
49
+        }
50
+
51
+        return inventoryValue;
52
+
53
+    }
6 54
 
7 55
 
8 56
 

+ 43
- 1
src/main/java/com/zipcodewilmington/productmanager/MainApplication.java View File

@@ -1,13 +1,55 @@
1 1
 package com.zipcodewilmington.productmanager;
2 2
 
3
+import java.util.ArrayList;
4
+
3 5
 /**
4 6
  * Created by leon on 1/10/18.
5 7
  */
6 8
 public class MainApplication {
7 9
 
8 10
     public static void main(String[] args) {
11
+        Product frisbee = new Product(15.99,24);
12
+        Product basketball = new Product(22.55,13);
13
+        Product soccerGoal = new Product(65.75,3);
14
+        Product soccerBall = new Product(20.02, 34);
15
+        Inventory sportStore = new Inventory();
16
+
17
+        String inventoryValue = String.format("%.2f", sportStore.getInventoryValue());
18
+
19
+        System.out.println("Welcome to the Sport Store");
20
+
21
+        /*System.out.println("\nItem Numbers:" +
22
+                "\nThe item number for a frisbee is: " + frisbee.getId() +
23
+                "\nThe item number for a basketball is: " + basketball.getId() +
24
+                "\nThe item number for a soccer goal is: " + soccerGoal.getId() +
25
+                "\nThe item number for a soccer ball is: " + soccerBall.getId()); */
26
+
27
+        System.out.println("\nQuantities:" +
28
+                "\nThe number of frisbees is: " + frisbee.getQuantity() +
29
+                "\nThe number of basketballs is: " + basketball.getQuantity() +
30
+                "\nThe number of soccer goals is: " + soccerGoal.getQuantity() +
31
+                "\nThe number of soccer balls is: " + soccerBall.getQuantity());
32
+
33
+        System.out.println("\nPrices:" +
34
+                "\nThe price of a frisbee is: $" + frisbee.getPrice() +
35
+                "\nThe price of a basketball is: $" + basketball.getPrice() +
36
+                "\nThe price of a soccer goal is: $" + soccerGoal.getPrice() +
37
+                "\nThe price of a soccer ball is: $" + soccerBall.getPrice());
38
+
39
+
40
+        System.out.println("\nThe total inventory value is: $" + inventoryValue + ".");
9 41
 
42
+        basketball.setQuantity(20);
43
+
44
+        System.out.println("\nThe quantity of basketballs is now: " + basketball.getQuantity());
45
+
46
+        frisbee.setPrice(10.99);
47
+
48
+        System.out.println("\nThe price of a frisbee is now: $" + frisbee.getPrice());
10 49
 
11 50
     }
12 51
 
13
-}
52
+
53
+    }
54
+
55
+

+ 17
- 3
src/main/java/com/zipcodewilmington/productmanager/Product.java View File

@@ -1,18 +1,25 @@
1 1
 package com.zipcodewilmington.productmanager;
2 2
 
3
+import java.util.ArrayList;
4
+
3 5
 /**
4 6
  * Created by leon on 1/10/18.
5 7
  */
6 8
 public class Product {
7 9
 
8
-    private double price;
9
-    private int quantity;
10
-    private static long id = 1;
10
+    private double price = 0.00;
11
+    private int quantity = 0;
12
+    private double value = 0.00;
13
+    private static int id = 1;
14
+    private static ArrayList<Product> ProductList = new ArrayList<Product>();
15
+
11 16
 
12 17
     public Product(double price, int quantity) {
13 18
         this.price = price;
14 19
         this.quantity = quantity;
15 20
         this.id = id++;
21
+        this.value = this.price * (double) this.quantity;
22
+        ProductList.add(this);
16 23
     }
17 24
 
18 25
     public double getPrice() {
@@ -35,4 +42,11 @@ public class Product {
35 42
         return id;
36 43
     }
37 44
 
45
+    public double getValue() {
46
+        return value;
47
+    }
48
+
49
+    public static ArrayList<Product> getProductList() {
50
+        return ProductList;
51
+    }
38 52
 }

+ 82
- 0
src/test/java/com/zipcodewilmington/productmanager/InventoryTest.java View File

@@ -0,0 +1,82 @@
1
+package com.zipcodewilmington.productmanager;
2
+
3
+import org.junit.Assert;
4
+import org.junit.Test;
5
+
6
+import java.lang.reflect.Array;
7
+import java.util.ArrayList;
8
+
9
+
10
+
11
+public class InventoryTest {
12
+
13
+    @Test
14
+    public void testCalcInventoryValue() {
15
+        //Given
16
+        Inventory newInv = new Inventory();
17
+        ArrayList<Double> values = new ArrayList<Double>();
18
+        values.add(5.15);
19
+        values.add(3.42);
20
+        values.add(18.77);
21
+        values.add(12.20);
22
+        double expected = 39.54;
23
+
24
+
25
+        //When
26
+        double actual = newInv.calcInventoryValue(values);
27
+
28
+        //Then
29
+        Assert.assertEquals(expected, actual, 0.01);
30
+    }
31
+
32
+    @Test
33
+    public void testGetProductList() {
34
+        //Given
35
+        Product product = new Product(6.00, 10);
36
+        Product product2 = new Product(8.00, 12);
37
+        Inventory newInv = new Inventory();
38
+        ArrayList<Product> expected = Product.getProductList();
39
+
40
+
41
+        //When
42
+        ArrayList<Product> actual = newInv.getProductList();
43
+
44
+        //Then
45
+        Assert.assertEquals(expected, actual);
46
+    }
47
+
48
+    @Test
49
+    public void testGetListOfValues() {
50
+        //Given
51
+        Product product = new Product(6.00, 10);
52
+        Product product2 = new Product(8.00, 12);
53
+        Inventory newInventory = new Inventory();
54
+        ArrayList<Double> expected = new ArrayList<Double>();
55
+        expected.add(60.00);
56
+        expected.add(96.00);
57
+
58
+
59
+        //When
60
+        ArrayList<Double> actual = new ArrayList<Double>(newInventory.getListOfValues());
61
+
62
+        //Then
63
+        Assert.assertEquals(expected, actual);
64
+    }
65
+
66
+
67
+    @Test
68
+    public void testGetInvValue() {
69
+        //Given
70
+        Product product = new Product(6.00, 10);
71
+        Product product2 = new Product(8.00, 12);
72
+        Inventory newInventory = new Inventory();
73
+        double expected = 156.00;
74
+
75
+
76
+        //When
77
+        double actual = newInventory.getInventoryValue();
78
+
79
+        //Then
80
+        Assert.assertEquals(expected, actual, 0.01);
81
+    }
82
+}

+ 53
- 2
src/test/java/com/zipcodewilmington/productmanager/ProductTest.java View File

@@ -2,12 +2,29 @@ package com.zipcodewilmington.productmanager;
2 2
 import org.junit.Assert;
3 3
 import org.junit.Test;
4 4
 
5
+import java.util.ArrayList;
6
+
5 7
 /**
6 8
  * Created by leon on 1/10/18.
7 9
  */
8 10
 public class ProductTest {
9 11
 
10 12
     @Test
13
+    public void testGetValueGetProductList() {
14
+        //Given
15
+        Product product = new Product(6.00, 10);
16
+        Product product2 = new Product(8.00, 12);
17
+        ArrayList<Product> products = new ArrayList<Product>(Product.getProductList());
18
+        double expected = 60.00;
19
+
20
+        //When
21
+        double actual = products.get(0).getValue();
22
+
23
+        //Then
24
+        Assert.assertEquals(expected, actual, 0.01);
25
+    }
26
+
27
+    @Test
11 28
     public void testProductConstructorPrice() {
12 29
     // Given
13 30
         double price = 6.00;
@@ -42,7 +59,7 @@ public class ProductTest {
42 59
     }
43 60
 
44 61
     @Test
45
-    public void testSetPrice() {
62
+    public void testSetGetPrice() {
46 63
         // Given
47 64
         double price = 6.00;
48 65
         int quantity = 10;
@@ -60,7 +77,7 @@ public class ProductTest {
60 77
     }
61 78
 
62 79
     @Test
63
-    public void testSetQuantity() {
80
+    public void testSetGetQuantity() {
64 81
         // Given
65 82
         double price = 6.00;
66 83
         int quantity = 10;
@@ -76,4 +93,38 @@ public class ProductTest {
76 93
         Assert.assertEquals(expected, actual, 0.01);
77 94
 
78 95
     }
96
+
97
+    @Test
98
+    public void testGetValue() {
99
+        // Given
100
+        double price = 6.00;
101
+        int quantity = 10;
102
+        double expected = 60.00;
103
+
104
+        //When
105
+        Product product = new Product(price, quantity);
106
+        double actual = product.getValue();;
107
+
108
+        //Then
109
+        Assert.assertEquals(expected, actual, 0.01);
110
+
111
+    }
112
+
113
+    @Test
114
+    public void testGetId() {
115
+        // Given
116
+        double price = 6.00;
117
+        int quantity = 10;
118
+        long expected = 1;
119
+
120
+        //When
121
+        Product product = new Product(price, quantity);
122
+        double actual = product.getId();;
123
+
124
+        //Then
125
+        Assert.assertEquals(expected, actual, 0.01);
126
+
127
+    }
128
+
129
+
79 130
 }