Bladeren bron

added generic class

mpierse 6 jaren geleden
bovenliggende
commit
169e0e30b0

+ 116
- 81
.idea/workspace.xml Bestand weergeven

@@ -2,8 +2,8 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="926ad23d-2ddc-41ae-980d-780dcc1811fa" name="Default" comment="">
5
-      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
6 5
       <change beforePath="$PROJECT_DIR$/Checkbook/src/main/java/Checkbook.java" beforeDir="false" afterPath="$PROJECT_DIR$/Checkbook/src/main/java/Checkbook.java" afterDir="false" />
6
+      <change beforePath="$PROJECT_DIR$/Checkbook/src/main/java/GenericAccount.java" beforeDir="false" afterPath="$PROJECT_DIR$/Checkbook/src/main/java/GenericAccount.java" afterDir="false" />
7 7
       <change beforePath="$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java" afterDir="false" />
8 8
     </list>
9 9
     <ignored path="$PROJECT_DIR$/Checkbook/target/" />
@@ -23,26 +23,28 @@
23 23
       </usages-collector>
24 24
       <usages-collector id="statistics.file.extensions.open">
25 25
         <counts>
26
+          <entry key="class" value="1" />
26 27
           <entry key="iml" value="1" />
27
-          <entry key="java" value="10" />
28
+          <entry key="java" value="11" />
28 29
           <entry key="md" value="1" />
29 30
         </counts>
30 31
       </usages-collector>
31 32
       <usages-collector id="statistics.file.types.open">
32 33
         <counts>
34
+          <entry key="CLASS" value="1" />
33 35
           <entry key="IDEA_MODULE" value="1" />
34
-          <entry key="JAVA" value="10" />
36
+          <entry key="JAVA" value="11" />
35 37
           <entry key="Markdown" value="1" />
36 38
         </counts>
37 39
       </usages-collector>
38 40
       <usages-collector id="statistics.file.extensions.edit">
39 41
         <counts>
40
-          <entry key="java" value="1550" />
42
+          <entry key="java" value="1943" />
41 43
         </counts>
42 44
       </usages-collector>
43 45
       <usages-collector id="statistics.file.types.edit">
44 46
         <counts>
45
-          <entry key="JAVA" value="1550" />
47
+          <entry key="JAVA" value="1943" />
46 48
         </counts>
47 49
       </usages-collector>
48 50
     </session>
@@ -54,7 +56,7 @@
54 56
           <file pinned="false" current-in-tab="false">
55 57
             <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java">
56 58
               <provider selected="true" editor-type-id="text-editor">
57
-                <state relative-caret-position="240">
59
+                <state relative-caret-position="-169">
58 60
                   <caret line="16" column="5" lean-forward="true" selection-start-line="16" selection-start-column="5" selection-end-line="16" selection-end-column="5" />
59 61
                   <folding>
60 62
                     <element signature="imports" expanded="true" />
@@ -82,12 +84,14 @@
82 84
           <file pinned="false" current-in-tab="false">
83 85
             <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Checkbook.java">
84 86
               <provider selected="true" editor-type-id="text-editor">
85
-                <state relative-caret-position="1215">
86
-                  <caret line="81" column="4" selection-start-line="81" selection-start-column="4" selection-end-line="81" selection-end-column="4" />
87
+                <state relative-caret-position="266">
88
+                  <caret line="93" column="50" selection-start-line="93" selection-start-column="50" selection-end-line="93" selection-end-column="50" />
87 89
                   <folding>
88 90
                     <element signature="imports" expanded="true" />
89 91
                     <element signature="e#185#186#0" expanded="true" />
90 92
                     <element signature="e#239#240#0" expanded="true" />
93
+                    <element signature="e#391#392#0" expanded="true" />
94
+                    <element signature="e#415#416#0" expanded="true" />
91 95
                     <element signature="e#141#142#0" expanded="true" />
92 96
                     <element signature="e#170#171#0" expanded="true" />
93 97
                     <element signature="e#205#206#0" expanded="true" />
@@ -105,17 +109,21 @@
105 109
               </provider>
106 110
             </entry>
107 111
           </file>
108
-          <file pinned="false" current-in-tab="true">
112
+          <file pinned="false" current-in-tab="false">
109 113
             <entry file="file://$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java">
110 114
               <provider selected="true" editor-type-id="text-editor">
111
-                <state relative-caret-position="2235">
112
-                  <caret line="149" column="49" lean-forward="true" selection-start-line="149" selection-start-column="49" selection-end-line="149" selection-end-column="49" />
115
+                <state relative-caret-position="326">
116
+                  <caret line="162" column="5" lean-forward="true" selection-start-line="162" selection-start-column="5" selection-end-line="162" selection-end-column="5" />
113 117
                   <folding>
114 118
                     <element signature="imports" expanded="true" />
115 119
                     <element signature="e#1385#1386#0" expanded="true" />
116 120
                     <element signature="e#1406#1407#0" expanded="true" />
117 121
                     <element signature="e#2852#2853#0" expanded="true" />
118 122
                     <element signature="e#2932#2933#0" expanded="true" />
123
+                    <element signature="e#4437#4438#0" expanded="true" />
124
+                    <element signature="e#4458#4459#0" expanded="true" />
125
+                    <element signature="e#4621#4622#0" expanded="true" />
126
+                    <element signature="e#4685#4686#0" expanded="true" />
119 127
                   </folding>
120 128
                 </state>
121 129
               </provider>
@@ -124,8 +132,20 @@
124 132
           <file pinned="false" current-in-tab="false">
125 133
             <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/AccountBook.java">
126 134
               <provider selected="true" editor-type-id="text-editor">
127
-                <state relative-caret-position="30">
128
-                  <caret line="2" column="17" selection-start-line="2" selection-start-column="17" selection-end-line="2" selection-end-column="17" />
135
+                <state relative-caret-position="165">
136
+                  <caret line="11" column="1" lean-forward="true" selection-start-line="11" selection-start-column="1" selection-end-line="11" selection-end-column="1" />
137
+                </state>
138
+              </provider>
139
+            </entry>
140
+          </file>
141
+          <file pinned="false" current-in-tab="true">
142
+            <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/GenericAccount.java">
143
+              <provider selected="true" editor-type-id="text-editor">
144
+                <state relative-caret-position="75">
145
+                  <caret line="5" column="52" selection-start-line="5" selection-start-column="52" selection-end-line="5" selection-end-column="52" />
146
+                  <folding>
147
+                    <element signature="e#182#183#0" expanded="true" />
148
+                  </folding>
129 149
                 </state>
130 150
               </provider>
131 151
             </entry>
@@ -175,11 +195,11 @@
175 195
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Payee.java" />
176 196
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java" />
177 197
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/AccountBook.java" />
178
-        <option value="$PROJECT_DIR$/Checkbook/src/main/java/GenericAccount.java" />
179 198
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/TransactionType.java" />
180 199
         <option value="$PROJECT_DIR$/README.md" />
181
-        <option value="$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java" />
182 200
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Checkbook.java" />
201
+        <option value="$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java" />
202
+        <option value="$PROJECT_DIR$/Checkbook/src/main/java/GenericAccount.java" />
183 203
       </list>
184 204
     </option>
185 205
   </component>
@@ -258,7 +278,7 @@
258 278
   <component name="PropertiesComponent">
259 279
     <property name="WebServerToolWindowFactoryState" value="false" />
260 280
     <property name="aspect.path.notification.shown" value="true" />
261
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544292738352" />
281
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544299508052" />
262 282
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
263 283
     <property name="jdk.selected.JAVA_MODULE" value="1.8" />
264 284
     <property name="last_opened_file_path" value="$PROJECT_DIR$" />
@@ -288,7 +308,7 @@
288 308
       </list>
289 309
     </option>
290 310
   </component>
291
-  <component name="RunManager" selected="JUnit.CheckbookTest.getAllDebitTest">
311
+  <component name="RunManager" selected="JUnit.CheckbookTest">
292 312
     <configuration default="true" type="Applet" factoryName="Applet">
293 313
       <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
294 314
       <method v="2">
@@ -301,44 +321,42 @@
301 321
         <option name="Make" enabled="true" />
302 322
       </method>
303 323
     </configuration>
304
-    <configuration name="CheckbookTest.checkbookValue" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
324
+    <configuration name="CheckbookTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
305 325
       <module name="Checkbook" />
306 326
       <option name="PACKAGE_NAME" value="" />
307 327
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
308
-      <option name="METHOD_NAME" value="checkbookValue" />
309
-      <option name="TEST_OBJECT" value="method" />
310 328
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
311 329
       <method v="2">
312 330
         <option name="Make" enabled="true" />
313 331
       </method>
314 332
     </configuration>
315
-    <configuration name="CheckbookTest.getAllDebitTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
333
+    <configuration name="CheckbookTest.checkbookValue" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
316 334
       <module name="Checkbook" />
317 335
       <option name="PACKAGE_NAME" value="" />
318 336
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
319
-      <option name="METHOD_NAME" value="getAllDebitTest" />
337
+      <option name="METHOD_NAME" value="checkbookValue" />
320 338
       <option name="TEST_OBJECT" value="method" />
321 339
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
322 340
       <method v="2">
323 341
         <option name="Make" enabled="true" />
324 342
       </method>
325 343
     </configuration>
326
-    <configuration name="CheckbookTest.getTransactionForPayee" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
344
+    <configuration name="CheckbookTest.constructorOneParam" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
327 345
       <module name="Checkbook" />
328 346
       <option name="PACKAGE_NAME" value="" />
329 347
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
330
-      <option name="METHOD_NAME" value="getTransactionForPayee" />
348
+      <option name="METHOD_NAME" value="constructorOneParam" />
331 349
       <option name="TEST_OBJECT" value="method" />
332 350
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
333 351
       <method v="2">
334 352
         <option name="Make" enabled="true" />
335 353
       </method>
336 354
     </configuration>
337
-    <configuration name="CheckbookTest.getTransactionsForDateTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
355
+    <configuration name="CheckbookTest.getAllCreditTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
338 356
       <module name="Checkbook" />
339 357
       <option name="PACKAGE_NAME" value="" />
340 358
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
341
-      <option name="METHOD_NAME" value="getTransactionsForDateTest" />
359
+      <option name="METHOD_NAME" value="getAllCreditTest" />
342 360
       <option name="TEST_OBJECT" value="method" />
343 361
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
344 362
       <method v="2">
@@ -381,17 +399,17 @@
381 399
     </configuration>
382 400
     <list>
383 401
       <item itemvalue="JUnit.CheckbookTest.toArrayparam2test" />
402
+      <item itemvalue="JUnit.CheckbookTest.constructorOneParam" />
403
+      <item itemvalue="JUnit.CheckbookTest" />
404
+      <item itemvalue="JUnit.CheckbookTest.getAllCreditTest" />
384 405
       <item itemvalue="JUnit.CheckbookTest.checkbookValue" />
385
-      <item itemvalue="JUnit.CheckbookTest.getTransactionsForDateTest" />
386
-      <item itemvalue="JUnit.CheckbookTest.getTransactionForPayee" />
387
-      <item itemvalue="JUnit.CheckbookTest.getAllDebitTest" />
388 406
     </list>
389 407
     <recent_temporary>
390 408
       <list>
391
-        <item itemvalue="JUnit.CheckbookTest.getAllDebitTest" />
392
-        <item itemvalue="JUnit.CheckbookTest.getTransactionForPayee" />
393
-        <item itemvalue="JUnit.CheckbookTest.getTransactionsForDateTest" />
409
+        <item itemvalue="JUnit.CheckbookTest" />
394 410
         <item itemvalue="JUnit.CheckbookTest.checkbookValue" />
411
+        <item itemvalue="JUnit.CheckbookTest.getAllCreditTest" />
412
+        <item itemvalue="JUnit.CheckbookTest.constructorOneParam" />
395 413
         <item itemvalue="JUnit.CheckbookTest.toArrayparam2test" />
396 414
       </list>
397 415
     </recent_temporary>
@@ -407,49 +425,50 @@
407 425
       <option name="presentableId" value="Default" />
408 426
       <updated>1543958631974</updated>
409 427
       <workItem from="1543958633447" duration="3259000" />
410
-      <workItem from="1544205488920" duration="9178000" />
428
+      <workItem from="1544205488920" duration="14643000" />
411 429
     </task>
412 430
     <servers />
413 431
   </component>
414 432
   <component name="TestHistory">
415
-    <history-entry file="CheckbookTest_toArrayparam2test - 2018.12.07 at 16h 06m 47s.xml">
433
+    <history-entry file="CheckbookTest_toArrayparam2test - 2018.12.08 at 13h 33m 14s.xml">
416 434
       <configuration name="CheckbookTest.toArrayparam2test" configurationId="JUnit" />
417 435
     </history-entry>
418
-    <history-entry file="CheckbookTest_checkbookValue - 2018.12.07 at 16h 16m 13s.xml">
419
-      <configuration name="CheckbookTest.checkbookValue" configurationId="JUnit" />
436
+    <history-entry file="CheckbookTest_toArrayparam2test - 2018.12.08 at 13h 34m 50s.xml">
437
+      <configuration name="CheckbookTest.toArrayparam2test" configurationId="JUnit" />
420 438
     </history-entry>
421
-    <history-entry file="CheckbookTest_checkbookValue - 2018.12.07 at 16h 17m 33s.xml">
422
-      <configuration name="CheckbookTest.checkbookValue" configurationId="JUnit" />
439
+    <history-entry file="CheckbookTest_toArrayparam2test - 2018.12.08 at 13h 35m 11s.xml">
440
+      <configuration name="CheckbookTest.toArrayparam2test" configurationId="JUnit" />
423 441
     </history-entry>
424
-    <history-entry file="CheckbookTest_getTransactionsForDateTest - 2018.12.07 at 18h 17m 48s.xml">
425
-      <configuration name="CheckbookTest.getTransactionsForDateTest" configurationId="JUnit" />
442
+    <history-entry file="CheckbookTest_constructorOneParam - 2018.12.08 at 14h 20m 37s.xml">
443
+      <configuration name="CheckbookTest.constructorOneParam" configurationId="JUnit" />
426 444
     </history-entry>
427
-    <history-entry file="CheckbookTest_getTransactionForPayee - 2018.12.07 at 18h 20m 02s.xml">
428
-      <configuration name="CheckbookTest.getTransactionForPayee" configurationId="JUnit" />
445
+    <history-entry file="CheckbookTest - 2018.12.08 at 14h 23m 30s.xml">
446
+      <configuration name="CheckbookTest" configurationId="JUnit" />
429 447
     </history-entry>
430
-    <history-entry file="CheckbookTest_getTransactionForPayee - 2018.12.07 at 18h 20m 08s.xml">
431
-      <configuration name="CheckbookTest.getTransactionForPayee" configurationId="JUnit" />
448
+    <history-entry file="CheckbookTest_getAllCreditTest - 2018.12.08 at 14h 24m 06s.xml">
449
+      <configuration name="CheckbookTest.getAllCreditTest" configurationId="JUnit" />
432 450
     </history-entry>
433
-    <history-entry file="CheckbookTest_getTransactionForPayee - 2018.12.07 at 18h 25m 55s.xml">
434
-      <configuration name="CheckbookTest.getTransactionForPayee" configurationId="JUnit" />
451
+    <history-entry file="CheckbookTest_getAllCreditTest - 2018.12.08 at 14h 24m 48s.xml">
452
+      <configuration name="CheckbookTest.getAllCreditTest" configurationId="JUnit" />
435 453
     </history-entry>
436
-    <history-entry file="CheckbookTest_getTransactionForPayee - 2018.12.07 at 18h 27m 14s.xml">
437
-      <configuration name="CheckbookTest.getTransactionForPayee" configurationId="JUnit" />
454
+    <history-entry file="CheckbookTest_checkbookValue - 2018.12.08 at 14h 24m 53s.xml">
455
+      <configuration name="CheckbookTest.checkbookValue" configurationId="JUnit" />
438 456
     </history-entry>
439
-    <history-entry file="CheckbookTest_getTransactionForPayee - 2018.12.07 at 18h 27m 48s.xml">
440
-      <configuration name="CheckbookTest.getTransactionForPayee" configurationId="JUnit" />
457
+    <history-entry file="CheckbookTest_checkbookValue - 2018.12.08 at 14h 25m 31s.xml">
458
+      <configuration name="CheckbookTest.checkbookValue" configurationId="JUnit" />
441 459
     </history-entry>
442
-    <history-entry file="CheckbookTest_getAllDebitTest - 2018.12.07 at 18h 30m 33s.xml">
443
-      <configuration name="CheckbookTest.getAllDebitTest" configurationId="JUnit" />
460
+    <history-entry file="CheckbookTest - 2018.12.08 at 14h 25m 37s.xml">
461
+      <configuration name="CheckbookTest" configurationId="JUnit" />
444 462
     </history-entry>
445 463
   </component>
446 464
   <component name="TimeTrackingManager">
447
-    <option name="totallyTimeSpent" value="12437000" />
465
+    <option name="totallyTimeSpent" value="17902000" />
448 466
   </component>
449 467
   <component name="ToolWindowManager">
450 468
     <frame x="0" y="23" width="1440" height="805" extended-state="0" />
469
+    <editor active="true" />
451 470
     <layout>
452
-      <window_info content_ui="combo" id="Project" order="0" weight="0.2532189" />
471
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.2532189" />
453 472
       <window_info id="Structure" order="1" weight="0.25" />
454 473
       <window_info id="Image Layers" order="2" />
455 474
       <window_info id="Designer" order="3" />
@@ -460,8 +479,8 @@
460 479
       <window_info anchor="bottom" id="Messages" weight="0.32959327" />
461 480
       <window_info anchor="bottom" id="Message" order="0" />
462 481
       <window_info anchor="bottom" id="Find" order="1" />
463
-      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.32959327" />
464
-      <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
482
+      <window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.32959327" />
483
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.3997195" />
465 484
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
466 485
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
467 486
       <window_info anchor="bottom" id="TODO" order="6" />
@@ -529,13 +548,6 @@
529 548
         </state>
530 549
       </provider>
531 550
     </entry>
532
-    <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/GenericAccount.java">
533
-      <provider selected="true" editor-type-id="text-editor">
534
-        <state relative-caret-position="15">
535
-          <caret line="1" column="28" selection-start-line="1" selection-start-column="28" selection-end-line="1" selection-end-column="28" />
536
-        </state>
537
-      </provider>
538
-    </entry>
539 551
     <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/TransactionType.java">
540 552
       <provider selected="true" editor-type-id="text-editor">
541 553
         <state>
@@ -567,16 +579,9 @@
567 579
         </state>
568 580
       </provider>
569 581
     </entry>
570
-    <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/AccountBook.java">
571
-      <provider selected="true" editor-type-id="text-editor">
572
-        <state relative-caret-position="30">
573
-          <caret line="2" column="17" selection-start-line="2" selection-start-column="17" selection-end-line="2" selection-end-column="17" />
574
-        </state>
575
-      </provider>
576
-    </entry>
577 582
     <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java">
578 583
       <provider selected="true" editor-type-id="text-editor">
579
-        <state relative-caret-position="240">
584
+        <state relative-caret-position="-169">
580 585
           <caret line="16" column="5" lean-forward="true" selection-start-line="16" selection-start-column="5" selection-end-line="16" selection-end-column="5" />
581 586
           <folding>
582 587
             <element signature="imports" expanded="true" />
@@ -600,14 +605,41 @@
600 605
         </state>
601 606
       </provider>
602 607
     </entry>
608
+    <entry file="jar://$MAVEN_REPOSITORY$/junit/junit/4.0/junit-4.0.jar!/org/junit/internal/runners/TestMethodRunner.class">
609
+      <provider selected="true" editor-type-id="text-editor">
610
+        <state relative-caret-position="134">
611
+          <caret line="94" selection-start-line="94" selection-end-line="94" />
612
+        </state>
613
+      </provider>
614
+    </entry>
615
+    <entry file="file://$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java">
616
+      <provider selected="true" editor-type-id="text-editor">
617
+        <state relative-caret-position="326">
618
+          <caret line="162" column="5" lean-forward="true" selection-start-line="162" selection-start-column="5" selection-end-line="162" selection-end-column="5" />
619
+          <folding>
620
+            <element signature="imports" expanded="true" />
621
+            <element signature="e#1385#1386#0" expanded="true" />
622
+            <element signature="e#1406#1407#0" expanded="true" />
623
+            <element signature="e#2852#2853#0" expanded="true" />
624
+            <element signature="e#2932#2933#0" expanded="true" />
625
+            <element signature="e#4437#4438#0" expanded="true" />
626
+            <element signature="e#4458#4459#0" expanded="true" />
627
+            <element signature="e#4621#4622#0" expanded="true" />
628
+            <element signature="e#4685#4686#0" expanded="true" />
629
+          </folding>
630
+        </state>
631
+      </provider>
632
+    </entry>
603 633
     <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Checkbook.java">
604 634
       <provider selected="true" editor-type-id="text-editor">
605
-        <state relative-caret-position="1215">
606
-          <caret line="81" column="4" selection-start-line="81" selection-start-column="4" selection-end-line="81" selection-end-column="4" />
635
+        <state relative-caret-position="266">
636
+          <caret line="93" column="50" selection-start-line="93" selection-start-column="50" selection-end-line="93" selection-end-column="50" />
607 637
           <folding>
608 638
             <element signature="imports" expanded="true" />
609 639
             <element signature="e#185#186#0" expanded="true" />
610 640
             <element signature="e#239#240#0" expanded="true" />
641
+            <element signature="e#391#392#0" expanded="true" />
642
+            <element signature="e#415#416#0" expanded="true" />
611 643
             <element signature="e#141#142#0" expanded="true" />
612 644
             <element signature="e#170#171#0" expanded="true" />
613 645
             <element signature="e#205#206#0" expanded="true" />
@@ -624,16 +656,19 @@
624 656
         </state>
625 657
       </provider>
626 658
     </entry>
627
-    <entry file="file://$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java">
659
+    <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/AccountBook.java">
660
+      <provider selected="true" editor-type-id="text-editor">
661
+        <state relative-caret-position="165">
662
+          <caret line="11" column="1" lean-forward="true" selection-start-line="11" selection-start-column="1" selection-end-line="11" selection-end-column="1" />
663
+        </state>
664
+      </provider>
665
+    </entry>
666
+    <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/GenericAccount.java">
628 667
       <provider selected="true" editor-type-id="text-editor">
629
-        <state relative-caret-position="2235">
630
-          <caret line="149" column="49" lean-forward="true" selection-start-line="149" selection-start-column="49" selection-end-line="149" selection-end-column="49" />
668
+        <state relative-caret-position="75">
669
+          <caret line="5" column="52" selection-start-line="5" selection-start-column="52" selection-end-line="5" selection-end-column="52" />
631 670
           <folding>
632
-            <element signature="imports" expanded="true" />
633
-            <element signature="e#1385#1386#0" expanded="true" />
634
-            <element signature="e#1406#1407#0" expanded="true" />
635
-            <element signature="e#2852#2853#0" expanded="true" />
636
-            <element signature="e#2932#2933#0" expanded="true" />
671
+            <element signature="e#182#183#0" expanded="true" />
637 672
           </folding>
638 673
         </state>
639 674
       </provider>

+ 13
- 3
Checkbook/src/main/java/Checkbook.java Bestand weergeven

@@ -13,6 +13,14 @@ private ArrayList<Transaction> transactionList = new ArrayList<>();
13 13
         this.transactionList = transactionList;
14 14
     }
15 15
 
16
+    public Checkbook(double cashAmount){
17
+        this.add(new Transaction("",new Payee(),TransactionType.DEBIT, cashAmount));
18
+    }
19
+
20
+    public Checkbook(Payee owner, double cashAmount){
21
+        this.add(new Transaction("",owner,TransactionType.DEBIT, cashAmount));
22
+    }
23
+
16 24
     public int size(){
17 25
     return transactionList.size();
18 26
     }
@@ -43,8 +51,10 @@ private ArrayList<Transaction> transactionList = new ArrayList<>();
43 51
     }
44 52
 
45 53
     public Transaction[] toArray(Transaction[] input) {
46
-        Transaction[] arr = transactionList.toArray(input);
47
-        return arr;
54
+        for (Transaction t : input) {
55
+            transactionList.add(t);
56
+        }
57
+        return transactionList.toArray(new Transaction[transactionList.size()]);
48 58
     }
49 59
 
50 60
     public double checkbookValue() {
@@ -81,7 +91,7 @@ private ArrayList<Transaction> transactionList = new ArrayList<>();
81 91
     public Transaction[] getAllCredit() {
82 92
         ArrayList<Transaction> list = new ArrayList<>();
83 93
         for (Transaction t: transactionList) {
84
-            if(t.getType()==TransactionType.DEBIT) list.add(t);
94
+            if(t.getType()==TransactionType.CREDIT) list.add(t);
85 95
         }
86 96
         return list.toArray(new Transaction[0]);
87 97
     }

+ 7
- 1
Checkbook/src/main/java/GenericAccount.java Bestand weergeven

@@ -1,3 +1,9 @@
1 1
 
2
-public class GenericAccount {
2
+public class GenericAccount <T extends AccountBook>{
3
+
4
+    AccountBook accountBook;
5
+
6
+    public GenericAccount(AccountBook accountBook) {
7
+        this.accountBook = accountBook;
8
+    }
3 9
 }

+ 15
- 5
Checkbook/src/test/java/CheckbookTest.java Bestand weergeven

@@ -13,7 +13,8 @@ public class CheckbookTest {
13 13
     ArrayList<Transaction> list;
14 14
     Transaction transaction = new Transaction("",new Payee(), TransactionType.DEBIT,1.50);
15 15
     Transaction transaction2 =new Transaction("test", new Payee(), TransactionType.CREDIT, 50.50);
16
-    Checkbook checkbookOneParam,
16
+    Checkbook checkbookOneParam = new Checkbook(3.00);
17
+    Checkbook checkbookTwoParam = new Checkbook(new Payee(), 5.00);
17 18
 
18 19
     @org.junit.Before
19 20
     public void setUp() throws Exception {
@@ -117,15 +118,15 @@ public class CheckbookTest {
117 118
 
118 119
     @Test
119 120
     public void toArrayparam2test(){
120
-        Transaction[] arr = new Transaction[0];
121
-        Transaction[] actual = checkbook2.toArray(arr);
122
-        Assert.assertEquals(Transaction[].class, actual.getClass());
121
+        Transaction[] arr = new Transaction[]{new Transaction("", new Payee(),TransactionType.DEBIT,3.00)};
122
+        Transaction[] actual = checkbook.toArray(arr);
123
+        Assert.assertEquals(3, actual.length);
123 124
     }
124 125
 
125 126
     @Test
126 127
     public void checkbookValue(){
127 128
        double actual = checkbook.checkbookValue();
128
-    Assert.assertEquals(-52.0, actual);
129
+    Assert.assertEquals(-49.0, actual);
129 130
     }
130 131
 
131 132
     @Test
@@ -151,4 +152,13 @@ public class CheckbookTest {
151 152
         Assert.assertEquals(arr, checkbook.getAllCredit());
152 153
     }
153 154
 
155
+    @Test
156
+    public void constructorOneParam(){
157
+        Assert.assertEquals(1, checkbookOneParam.size());
158
+    }
159
+
160
+    @Test
161
+    public void constructorTwoParam(){
162
+        Assert.assertEquals(1, checkbookTwoParam.size());
163
+    }
154 164
 }