Browse Source

friday morn

Seth 6 years ago
parent
commit
5175c51143

+ 83
- 87
.idea/workspace.xml View File

@@ -2,7 +2,10 @@
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 beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6
+      <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" />
5 7
       <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" />
8
+      <change beforePath="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/InventoryTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/InventoryTest.java" afterDir="false" />
6 9
     </list>
7 10
     <ignored path="$PROJECT_DIR$/out/" />
8 11
     <ignored path="$PROJECT_DIR$/target/" />
@@ -16,7 +19,7 @@
16 19
     <session id="172680794">
17 20
       <usages-collector id="statistics.lifecycle.project">
18 21
         <counts>
19
-          <entry key="project.closed" value="1" />
22
+          <entry key="project.closed" value="2" />
20 23
           <entry key="project.open.time.2" value="1" />
21 24
           <entry key="project.open.time.3" value="1" />
22 25
           <entry key="project.opened" value="2" />
@@ -24,27 +27,29 @@
24 27
       </usages-collector>
25 28
       <usages-collector id="statistics.file.extensions.edit">
26 29
         <counts>
27
-          <entry key="java" value="2157" />
30
+          <entry key="java" value="3427" />
28 31
           <entry key="xml" value="1" />
29 32
         </counts>
30 33
       </usages-collector>
31 34
       <usages-collector id="statistics.file.types.edit">
32 35
         <counts>
33
-          <entry key="JAVA" value="2157" />
36
+          <entry key="JAVA" value="3427" />
34 37
           <entry key="XML" value="1" />
35 38
         </counts>
36 39
       </usages-collector>
37 40
       <usages-collector id="statistics.file.extensions.open">
38 41
         <counts>
39
-          <entry key="iml" value="1" />
40
-          <entry key="java" value="3" />
42
+          <entry key="iml" value="2" />
43
+          <entry key="java" value="4" />
44
+          <entry key="md" value="1" />
41 45
           <entry key="xml" value="1" />
42 46
         </counts>
43 47
       </usages-collector>
44 48
       <usages-collector id="statistics.file.types.open">
45 49
         <counts>
46
-          <entry key="IDEA_MODULE" value="1" />
47
-          <entry key="JAVA" value="3" />
50
+          <entry key="IDEA_MODULE" value="2" />
51
+          <entry key="JAVA" value="4" />
52
+          <entry key="Markdown" value="1" />
48 53
           <entry key="XML" value="1" />
49 54
         </counts>
50 55
       </usages-collector>
@@ -53,21 +58,9 @@
53 58
   <component name="FileEditorManager">
54 59
     <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
55 60
       <file pinned="false" current-in-tab="false">
56
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/MainApplication.java">
57
-          <provider selected="true" editor-type-id="text-editor">
58
-            <state relative-caret-position="255">
59
-              <caret line="17" column="53" selection-start-line="17" selection-start-column="53" selection-end-line="17" selection-end-column="53" />
60
-              <folding>
61
-                <element signature="imports" expanded="true" />
62
-              </folding>
63
-            </state>
64
-          </provider>
65
-        </entry>
66
-      </file>
67
-      <file pinned="false" current-in-tab="false">
68 61
         <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/ProductTest.java">
69 62
           <provider selected="true" editor-type-id="text-editor">
70
-            <state relative-caret-position="-34">
63
+            <state relative-caret-position="632">
71 64
               <caret line="58" column="15" lean-forward="true" selection-start-line="58" selection-start-column="15" selection-end-line="58" selection-end-column="15" />
72 65
               <folding>
73 66
                 <element signature="imports" expanded="true" />
@@ -76,10 +69,10 @@
76 69
           </provider>
77 70
         </entry>
78 71
       </file>
79
-      <file pinned="false" current-in-tab="false">
72
+      <file pinned="false" current-in-tab="true">
80 73
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Product.java">
81 74
           <provider selected="true" editor-type-id="text-editor">
82
-            <state relative-caret-position="165">
75
+            <state relative-caret-position="125">
83 76
               <caret line="11" column="49" lean-forward="true" selection-start-line="11" selection-start-column="49" selection-end-line="11" selection-end-column="49" />
84 77
               <folding>
85 78
                 <element signature="e#649#650#0" expanded="true" />
@@ -89,11 +82,11 @@
89 82
           </provider>
90 83
         </entry>
91 84
       </file>
92
-      <file pinned="false" current-in-tab="true">
93
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Inventory.java">
85
+      <file pinned="false" current-in-tab="false">
86
+        <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/InventoryTest.java">
94 87
           <provider selected="true" editor-type-id="text-editor">
95 88
             <state relative-caret-position="135">
96
-              <caret line="9" column="34" selection-start-line="9" selection-start-column="34" selection-end-line="9" selection-end-column="34" />
89
+              <caret line="9" column="1" lean-forward="true" selection-start-line="9" selection-start-column="1" selection-end-line="9" selection-end-column="1" />
97 90
               <folding>
98 91
                 <element signature="imports" expanded="true" />
99 92
               </folding>
@@ -102,24 +95,6 @@
102 95
         </entry>
103 96
       </file>
104 97
       <file pinned="false" current-in-tab="false">
105
-        <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/InventoryTest.java">
106
-          <provider selected="true" editor-type-id="text-editor">
107
-            <state relative-caret-position="105">
108
-              <caret line="7" column="15" selection-start-line="7" selection-start-column="15" selection-end-line="7" selection-end-column="15" />
109
-            </state>
110
-          </provider>
111
-        </entry>
112
-      </file>
113
-      <file pinned="false" current-in-tab="false">
114
-        <entry file="file://$PROJECT_DIR$/pom.xml">
115
-          <provider selected="true" editor-type-id="text-editor">
116
-            <state relative-caret-position="210">
117
-              <caret line="14" column="21" lean-forward="true" selection-start-line="14" selection-start-column="21" selection-end-line="14" selection-end-column="21" />
118
-            </state>
119
-          </provider>
120
-        </entry>
121
-      </file>
122
-      <file pinned="false" current-in-tab="false">
123 98
         <entry file="file://$PROJECT_DIR$/README.md">
124 99
           <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
125 100
             <state split_layout="SPLIT">
@@ -131,6 +106,20 @@
131 106
           </provider>
132 107
         </entry>
133 108
       </file>
109
+      <file pinned="false" current-in-tab="false">
110
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Inventory.java">
111
+          <provider selected="true" editor-type-id="text-editor">
112
+            <state relative-caret-position="50">
113
+              <caret line="21" lean-forward="true" selection-start-line="21" selection-end-line="21" />
114
+              <folding>
115
+                <element signature="imports" expanded="true" />
116
+                <element signature="e#670#671#0" expanded="true" />
117
+                <element signature="e#712#713#0" expanded="true" />
118
+              </folding>
119
+            </state>
120
+          </provider>
121
+        </entry>
122
+      </file>
134 123
     </leaf>
135 124
   </component>
136 125
   <component name="FileTemplateManagerImpl">
@@ -151,9 +140,9 @@
151 140
         <option value="$PROJECT_DIR$/pom.xml" />
152 141
         <option value="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/ProductTest.java" />
153 142
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Product.java" />
154
-        <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Inventory.java" />
155 143
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/MainApplication.java" />
156 144
         <option value="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/InventoryTest.java" />
145
+        <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Inventory.java" />
157 146
       </list>
158 147
     </option>
159 148
   </component>
@@ -171,8 +160,7 @@
171 160
     </option>
172 161
   </component>
173 162
   <component name="ProjectFrameBounds">
174
-    <option name="x" value="-91" />
175
-    <option name="y" value="-909" />
163
+    <option name="y" value="23" />
176 164
     <option name="width" value="1440" />
177 165
     <option name="height" value="807" />
178 166
   </component>
@@ -253,7 +241,7 @@
253 241
     <property name="SearchEverywhereHistoryKey" value="&#9;FILE&#9;file:///Users/sethabrams/Labs/Week 2/CR-MesoLabs-Inheritance-ProductManager/src/main/java/com/zipcodewilmington/productmanager/Inventory.java" />
254 242
     <property name="WebServerToolWindowFactoryState" value="false" />
255 243
     <property name="aspect.path.notification.shown" value="true" />
256
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1540505476359" />
244
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1540554745611" />
257 245
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
258 246
     <property name="project.structure.last.edited" value="Project" />
259 247
     <property name="project.structure.proportion" value="0.0" />
@@ -272,7 +260,7 @@
272 260
       </list>
273 261
     </option>
274 262
   </component>
275
-  <component name="RunManager" selected="Application.MainApplication">
263
+  <component name="RunManager" selected="JUnit.InventoryTest">
276 264
     <configuration default="true" type="AndroidTestRunConfigurationType" factoryName="Android Tests">
277 265
       <module name="" />
278 266
       <option name="TESTING_TYPE" value="0" />
@@ -339,7 +327,7 @@
339 327
         <option name="Make" enabled="true" />
340 328
       </method>
341 329
     </configuration>
342
-    <configuration name="ProductTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
330
+    <configuration name="InventoryTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
343 331
       <module name="productmanager" />
344 332
       <extension name="coverage">
345 333
         <pattern>
@@ -348,13 +336,13 @@
348 336
         </pattern>
349 337
       </extension>
350 338
       <option name="PACKAGE_NAME" value="com.zipcodewilmington.productmanager" />
351
-      <option name="MAIN_CLASS_NAME" value="com.zipcodewilmington.productmanager.ProductTest" />
339
+      <option name="MAIN_CLASS_NAME" value="com.zipcodewilmington.productmanager.InventoryTest" />
352 340
       <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
353 341
       <method v="2">
354 342
         <option name="Make" enabled="true" />
355 343
       </method>
356 344
     </configuration>
357
-    <configuration name="ProductTest.getPriceTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
345
+    <configuration name="InventoryTest.addProductTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
358 346
       <module name="productmanager" />
359 347
       <extension name="coverage">
360 348
         <pattern>
@@ -363,8 +351,8 @@
363 351
         </pattern>
364 352
       </extension>
365 353
       <option name="PACKAGE_NAME" value="com.zipcodewilmington.productmanager" />
366
-      <option name="MAIN_CLASS_NAME" value="com.zipcodewilmington.productmanager.ProductTest" />
367
-      <option name="METHOD_NAME" value="getPriceTest" />
354
+      <option name="MAIN_CLASS_NAME" value="com.zipcodewilmington.productmanager.InventoryTest" />
355
+      <option name="METHOD_NAME" value="addProductTest" />
368 356
       <option name="TEST_OBJECT" value="method" />
369 357
       <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
370 358
       <method v="2">
@@ -442,19 +430,19 @@
442 430
       </method>
443 431
     </configuration>
444 432
     <list>
445
-      <item itemvalue="JUnit.ProductTest.getPriceTest" />
446
-      <item itemvalue="JUnit.ProductTest" />
447 433
       <item itemvalue="JUnit.ProductTest.setQuantityTest" />
448 434
       <item itemvalue="JUnit.ProductTest.setPriceTest" />
449 435
       <item itemvalue="Application.MainApplication" />
436
+      <item itemvalue="JUnit.InventoryTest.addProductTest" />
437
+      <item itemvalue="JUnit.InventoryTest" />
450 438
     </list>
451 439
     <recent_temporary>
452 440
       <list>
441
+        <item itemvalue="JUnit.InventoryTest" />
442
+        <item itemvalue="JUnit.InventoryTest.addProductTest" />
453 443
         <item itemvalue="Application.MainApplication" />
454 444
         <item itemvalue="JUnit.ProductTest.setPriceTest" />
455 445
         <item itemvalue="JUnit.ProductTest.setQuantityTest" />
456
-        <item itemvalue="JUnit.ProductTest.getPriceTest" />
457
-        <item itemvalue="JUnit.ProductTest" />
458 446
       </list>
459 447
     </recent_temporary>
460 448
   </component>
@@ -469,20 +457,11 @@
469 457
       <option name="presentableId" value="Default" />
470 458
       <updated>1515620835041</updated>
471 459
       <workItem from="1540421277505" duration="6605000" />
472
-      <workItem from="1540489005464" duration="9846000" />
460
+      <workItem from="1540489005464" duration="18600000" />
473 461
     </task>
474 462
     <servers />
475 463
   </component>
476 464
   <component name="TestHistory">
477
-    <history-entry file="ProductTest_getPriceTest - 2018.10.25 at 14h 29m 04s.xml">
478
-      <configuration name="ProductTest.getPriceTest" configurationId="JUnit" />
479
-    </history-entry>
480
-    <history-entry file="ProductTest_getPriceTest - 2018.10.25 at 15h 56m 47s.xml">
481
-      <configuration name="ProductTest.getPriceTest" configurationId="JUnit" />
482
-    </history-entry>
483
-    <history-entry file="ProductTest_getPriceTest - 2018.10.25 at 16h 34m 58s.xml">
484
-      <configuration name="ProductTest.getPriceTest" configurationId="JUnit" />
485
-    </history-entry>
486 465
     <history-entry file="ProductTest_getQuantityTest - 2018.10.25 at 16h 50m 12s.xml">
487 466
       <configuration name="ProductTest.getQuantityTest" configurationId="JUnit" />
488 467
     </history-entry>
@@ -504,15 +483,24 @@
504 483
     <history-entry file="ProductTest_setPriceTest - 2018.10.25 at 17h 16m 56s.xml">
505 484
       <configuration name="ProductTest.setPriceTest" configurationId="JUnit" />
506 485
     </history-entry>
486
+    <history-entry file="InventoryTest_addProductTest - 2018.10.25 at 20h 11m 08s.xml">
487
+      <configuration name="InventoryTest.addProductTest" configurationId="JUnit" />
488
+    </history-entry>
489
+    <history-entry file="InventoryTest_addProductTest - 2018.10.25 at 20h 38m 21s.xml">
490
+      <configuration name="InventoryTest.addProductTest" configurationId="JUnit" />
491
+    </history-entry>
492
+    <history-entry file="InventoryTest - 2018.10.25 at 20h 38m 43s.xml">
493
+      <configuration name="InventoryTest" configurationId="JUnit" />
494
+    </history-entry>
507 495
   </component>
508 496
   <component name="TimeTrackingManager">
509
-    <option name="totallyTimeSpent" value="16451000" />
497
+    <option name="totallyTimeSpent" value="25205000" />
510 498
   </component>
511 499
   <component name="ToolWindowManager">
512
-    <frame x="-91" y="-909" width="1440" height="807" extended-state="0" />
500
+    <frame x="0" y="23" width="1440" height="807" extended-state="0" />
513 501
     <editor active="true" />
514 502
     <layout>
515
-      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.25679544" />
503
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.29470673" />
516 504
       <window_info id="Structure" order="1" weight="0.25" />
517 505
       <window_info id="Nl-Palette" order="2" />
518 506
       <window_info id="Favorites" order="3" side_tool="true" />
@@ -522,7 +510,7 @@
522 510
       <window_info id="Capture Tool" order="7" />
523 511
       <window_info anchor="bottom" id="Message" order="0" />
524 512
       <window_info anchor="bottom" id="Find" order="1" />
525
-      <window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.32867134" />
513
+      <window_info anchor="bottom" id="Run" order="2" weight="0.38181818" />
526 514
       <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
527 515
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
528 516
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
@@ -611,7 +599,7 @@
611 599
     </entry>
612 600
     <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/ProductTest.java">
613 601
       <provider selected="true" editor-type-id="text-editor">
614
-        <state relative-caret-position="-34">
602
+        <state relative-caret-position="632">
615 603
           <caret line="58" column="15" lean-forward="true" selection-start-line="58" selection-start-column="15" selection-end-line="58" selection-end-column="15" />
616 604
           <folding>
617 605
             <element signature="imports" expanded="true" />
@@ -619,40 +607,48 @@
619 607
         </state>
620 608
       </provider>
621 609
     </entry>
622
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Product.java">
610
+    <entry file="file://$PROJECT_DIR$/productmanager.iml">
611
+      <provider selected="true" editor-type-id="text-editor" />
612
+    </entry>
613
+    <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/InventoryTest.java">
623 614
       <provider selected="true" editor-type-id="text-editor">
624
-        <state relative-caret-position="165">
625
-          <caret line="11" column="49" lean-forward="true" selection-start-line="11" selection-start-column="49" selection-end-line="11" selection-end-column="49" />
615
+        <state relative-caret-position="135">
616
+          <caret line="9" column="1" lean-forward="true" selection-start-line="9" selection-start-column="1" selection-end-line="9" selection-end-column="1" />
626 617
           <folding>
627
-            <element signature="e#649#650#0" expanded="true" />
628
-            <element signature="e#678#679#0" expanded="true" />
618
+            <element signature="imports" expanded="true" />
629 619
           </folding>
630 620
         </state>
631 621
       </provider>
632 622
     </entry>
633
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/MainApplication.java">
623
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Inventory.java">
634 624
       <provider selected="true" editor-type-id="text-editor">
635
-        <state relative-caret-position="255">
636
-          <caret line="17" column="53" selection-start-line="17" selection-start-column="53" selection-end-line="17" selection-end-column="53" />
625
+        <state relative-caret-position="50">
626
+          <caret line="21" lean-forward="true" selection-start-line="21" selection-end-line="21" />
637 627
           <folding>
638 628
             <element signature="imports" expanded="true" />
629
+            <element signature="e#670#671#0" expanded="true" />
630
+            <element signature="e#712#713#0" expanded="true" />
639 631
           </folding>
640 632
         </state>
641 633
       </provider>
642 634
     </entry>
643
-    <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/productmanager/InventoryTest.java">
635
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/MainApplication.java">
644 636
       <provider selected="true" editor-type-id="text-editor">
645
-        <state relative-caret-position="105">
646
-          <caret line="7" column="15" selection-start-line="7" selection-start-column="15" selection-end-line="7" selection-end-column="15" />
637
+        <state relative-caret-position="300">
638
+          <caret line="20" column="36" selection-start-line="20" selection-start-column="36" selection-end-line="20" selection-end-column="36" />
639
+          <folding>
640
+            <element signature="imports" expanded="true" />
641
+          </folding>
647 642
         </state>
648 643
       </provider>
649 644
     </entry>
650
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Inventory.java">
645
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/productmanager/Product.java">
651 646
       <provider selected="true" editor-type-id="text-editor">
652
-        <state relative-caret-position="135">
653
-          <caret line="9" column="34" selection-start-line="9" selection-start-column="34" selection-end-line="9" selection-end-column="34" />
647
+        <state relative-caret-position="125">
648
+          <caret line="11" column="49" lean-forward="true" selection-start-line="11" selection-start-column="49" selection-end-line="11" selection-end-column="49" />
654 649
           <folding>
655
-            <element signature="imports" expanded="true" />
650
+            <element signature="e#649#650#0" expanded="true" />
651
+            <element signature="e#678#679#0" expanded="true" />
656 652
           </folding>
657 653
         </state>
658 654
       </provider>

+ 20
- 2
src/main/java/com/zipcodewilmington/productmanager/Inventory.java View File

@@ -5,16 +5,34 @@ import java.util.List;
5 5
 
6 6
 public class Inventory {
7 7
 
8
-   private List<Product> inventoryList = new ArrayList<>();
8
+    private ArrayList<Product> inventoryList = new ArrayList<>();
9
+
10
+    public Inventory(){
11
+
12
+    }
9 13
 
10 14
     public List<Product> getInventoryList() {
11 15
 
12 16
         return inventoryList;
13 17
     }
14 18
 
15
-    public void setInventoryList(List<Product> inventoryList) {
19
+    public void setInventoryList(ArrayList<Product> inventoryList) {
20
+
16 21
         this.inventoryList = inventoryList;
17 22
 
18 23
     }
19 24
 
25
+    public int getQuantity() {
26
+        int total = 0;
27
+        for (Product eachProduct : inventoryList) {
28
+            total += eachProduct.getQuantity();
29
+        }
30
+        return total;
31
+    }
32
+
33
+
34
+    public void addProduct(Product product) {
35
+        inventoryList.add(product);
36
+    }
37
+
20 38
 }

+ 14
- 5
src/main/java/com/zipcodewilmington/productmanager/MainApplication.java View File

@@ -11,11 +11,20 @@ public class MainApplication {
11 11
 
12 12
     public static void main(String[] args) {
13 13
 
14
-        Product product1 = new Product(10, 5.0, 1);
15
-        Inventory inventory1 = new Inventory();
16
-        List<Product> list1 = inventory1.getInventoryList();
17
-        list1.add(product1);
18
-        System.out.println(list1.get(0).getQuantity());
14
+        Product notebooks = new Product(10, 5.0, 1);
15
+        Product pens = new Product(26, 3.0, 2);
16
+        Product pencils =  new Product(9, 2.0, 3);
17
+
18
+        Inventory inventory = new Inventory();
19
+        inventory.addProduct(notebooks);
20
+        inventory.addProduct(pens);
21
+        inventory.addProduct(pencils);
22
+
23
+
24
+
25
+//        List<Product> list1 = inventory1.getInventoryList();
26
+//        list1.add(product1);
27
+        //System.out.println(inventory1.get(0));
19 28
 
20 29
     }
21 30
 

+ 13
- 1
src/test/java/com/zipcodewilmington/productmanager/InventoryTest.java View File

@@ -1,9 +1,21 @@
1 1
 package com.zipcodewilmington.productmanager;
2 2
 
3
+import org.junit.Assert;
3 4
 import org.junit.Test;
5
+import java.util.ArrayList;
6
+import java.util.List;
4 7
 
5 8
 public class InventoryTest {
6 9
 
7 10
     @Test
8
-    public void
11
+    public void addProductTest() {
12
+        //Given
13
+        Product product1 = new Product(10, 5.0, 1);
14
+        Inventory actual = new Inventory();
15
+        //When
16
+        actual.addProduct(product1);
17
+        //Then
18
+        Assert.assertEquals(1, actual.getInventoryList().size());
19
+
20
+    }
9 21
 }