Ver código fonte

test methods

Trinh Tong 6 anos atrás
pai
commit
784eabb010
2 arquivos alterados com 100 adições e 78 exclusões
  1. 69
    72
      .idea/workspace.xml
  2. 31
    6
      Checkbook/src/test/java/CheckbookTest.java

+ 69
- 72
.idea/workspace.xml Ver arquivo

@@ -2,9 +2,6 @@
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$/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/Payee.java" beforeDir="false" afterPath="$PROJECT_DIR$/Checkbook/src/main/java/Payee.java" afterDir="false" />
7
-      <change beforePath="$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java" beforeDir="false" afterPath="$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java" afterDir="false" />
8 5
       <change beforePath="$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java" afterDir="false" />
9 6
     </list>
10 7
     <ignored path="$PROJECT_DIR$/Checkbook/target/" />
@@ -25,13 +22,13 @@
25 22
       <usages-collector id="statistics.file.types.open">
26 23
         <counts>
27 24
           <entry key="CLASS" value="6" />
28
-          <entry key="JAVA" value="43" />
25
+          <entry key="JAVA" value="44" />
29 26
           <entry key="Markdown" value="1" />
30 27
         </counts>
31 28
       </usages-collector>
32 29
       <usages-collector id="statistics.file.types.edit">
33 30
         <counts>
34
-          <entry key="JAVA" value="8937" />
31
+          <entry key="JAVA" value="9750" />
35 32
           <entry key="Markdown" value="11" />
36 33
         </counts>
37 34
       </usages-collector>
@@ -43,7 +40,7 @@
43 40
         <entry file="file://$PROJECT_DIR$/README.md">
44 41
           <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
45 42
             <state split_layout="FIRST">
46
-              <first_editor relative-caret-position="765">
43
+              <first_editor relative-caret-position="283">
47 44
                 <caret line="48" lean-forward="true" selection-start-line="48" selection-end-line="48" />
48 45
               </first_editor>
49 46
               <second_editor />
@@ -54,7 +51,7 @@
54 51
       <file pinned="false" current-in-tab="false">
55 52
         <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java">
56 53
           <provider selected="true" editor-type-id="text-editor">
57
-            <state relative-caret-position="185">
54
+            <state relative-caret-position="-279">
58 55
               <caret line="12" column="26" lean-forward="true" selection-start-line="12" selection-start-column="26" selection-end-line="12" selection-end-column="26" />
59 56
               <folding>
60 57
                 <element signature="imports" expanded="true" />
@@ -66,8 +63,8 @@
66 63
       <file pinned="false" current-in-tab="false">
67 64
         <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Checkbook.java">
68 65
           <provider selected="true" editor-type-id="text-editor">
69
-            <state relative-caret-position="279">
70
-              <caret line="83" column="16" selection-start-line="83" selection-start-column="16" selection-end-line="83" selection-end-column="16" />
66
+            <state relative-caret-position="-1294">
67
+              <caret line="45" lean-forward="true" selection-start-line="45" selection-end-line="45" />
71 68
               <folding>
72 69
                 <element signature="imports" expanded="true" />
73 70
                 <element signature="e#1262#1263#0" expanded="true" />
@@ -94,8 +91,8 @@
94 91
       <file pinned="false" current-in-tab="true">
95 92
         <entry file="file://$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java">
96 93
           <provider selected="true" editor-type-id="text-editor">
97
-            <state relative-caret-position="-209">
98
-              <caret line="228" column="5" selection-start-line="228" selection-start-column="5" selection-end-line="228" selection-end-column="5" />
94
+            <state relative-caret-position="362">
95
+              <caret line="354" column="94" selection-start-line="354" selection-start-column="94" selection-end-line="354" selection-end-column="94" />
99 96
               <folding>
100 97
                 <element signature="imports" expanded="true" />
101 98
               </folding>
@@ -154,8 +151,8 @@
154 151
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Account.java" />
155 152
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java" />
156 153
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Payee.java" />
157
-        <option value="$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java" />
158 154
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Checkbook.java" />
155
+        <option value="$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java" />
159 156
       </list>
160 157
     </option>
161 158
   </component>
@@ -241,7 +238,7 @@
241 238
   <component name="PropertiesComponent">
242 239
     <property name="WebServerToolWindowFactoryState" value="false" />
243 240
     <property name="aspect.path.notification.shown" value="true" />
244
-    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544124424998" />
241
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544135882851" />
245 242
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
246 243
     <property name="extract.method.default.visibility" value="private" />
247 244
     <property name="jdk.selected.JAVA_MODULE" value="1.8" />
@@ -272,7 +269,7 @@
272 269
       </list>
273 270
     </option>
274 271
   </component>
275
-  <component name="RunManager" selected="JUnit.CheckbookTest.getTransactionsForPayeeExists">
272
+  <component name="RunManager" selected="JUnit.CheckbookTest.testGetCreditsafterAdding">
276 273
     <configuration default="true" type="Applet" factoryName="Applet">
277 274
       <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
278 275
       <method v="2">
@@ -285,55 +282,55 @@
285 282
         <option name="Make" enabled="true" />
286 283
       </method>
287 284
     </configuration>
288
-    <configuration name="CheckbookTest.getTransactionAddingNewTForDateA" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
285
+    <configuration name="CheckbookTest.testGetCredits" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
289 286
       <module name="Checkbook" />
290 287
       <option name="PACKAGE_NAME" value="" />
291 288
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
292
-      <option name="METHOD_NAME" value="getTransactionAddingNewTForDateA" />
289
+      <option name="METHOD_NAME" value="testGetCredits" />
293 290
       <option name="TEST_OBJECT" value="method" />
294 291
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
295 292
       <method v="2">
296 293
         <option name="Make" enabled="true" />
297 294
       </method>
298 295
     </configuration>
299
-    <configuration name="CheckbookTest.getTransactionsForPayeeExists" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
296
+    <configuration name="CheckbookTest.testGetCreditsNone" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
300 297
       <module name="Checkbook" />
301 298
       <option name="PACKAGE_NAME" value="" />
302 299
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
303
-      <option name="METHOD_NAME" value="getTransactionsForPayeeExists" />
300
+      <option name="METHOD_NAME" value="testGetCreditsNone" />
304 301
       <option name="TEST_OBJECT" value="method" />
305 302
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
306 303
       <method v="2">
307 304
         <option name="Make" enabled="true" />
308 305
       </method>
309 306
     </configuration>
310
-    <configuration name="CheckbookTest.getTransactionsForPayeeExists2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
307
+    <configuration name="CheckbookTest.testGetCreditsafterAdding" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
311 308
       <module name="Checkbook" />
312 309
       <option name="PACKAGE_NAME" value="" />
313 310
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
314
-      <option name="METHOD_NAME" value="getTransactionsForPayeeExists2" />
311
+      <option name="METHOD_NAME" value="testGetCreditsafterAdding" />
315 312
       <option name="TEST_OBJECT" value="method" />
316 313
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
317 314
       <method v="2">
318 315
         <option name="Make" enabled="true" />
319 316
       </method>
320 317
     </configuration>
321
-    <configuration name="CheckbookTest.getTransactionsForPayeeExistsAfterAdd" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
318
+    <configuration name="CheckbookTest.testGetDebitsManipulatedCheckbook" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
322 319
       <module name="Checkbook" />
323 320
       <option name="PACKAGE_NAME" value="" />
324 321
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
325
-      <option name="METHOD_NAME" value="getTransactionsForPayeeExistsAfterAdd" />
322
+      <option name="METHOD_NAME" value="testGetDebitsManipulatedCheckbook" />
326 323
       <option name="TEST_OBJECT" value="method" />
327 324
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
328 325
       <method v="2">
329 326
         <option name="Make" enabled="true" />
330 327
       </method>
331 328
     </configuration>
332
-    <configuration name="CheckbookTest.getTransactionsForPayeeNotExists" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
329
+    <configuration name="CheckbookTest.testToArrayFailV2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
333 330
       <module name="Checkbook" />
334 331
       <option name="PACKAGE_NAME" value="" />
335 332
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
336
-      <option name="METHOD_NAME" value="getTransactionsForPayeeNotExists" />
333
+      <option name="METHOD_NAME" value="testToArrayFailV2" />
337 334
       <option name="TEST_OBJECT" value="method" />
338 335
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
339 336
       <method v="2">
@@ -364,19 +361,19 @@
364 361
       </method>
365 362
     </configuration>
366 363
     <list>
367
-      <item itemvalue="JUnit.CheckbookTest.getTransactionsForPayeeExists" />
368
-      <item itemvalue="JUnit.CheckbookTest.getTransactionsForPayeeExists2" />
369
-      <item itemvalue="JUnit.CheckbookTest.getTransactionsForPayeeNotExists" />
370
-      <item itemvalue="JUnit.CheckbookTest.getTransactionsForPayeeExistsAfterAdd" />
371
-      <item itemvalue="JUnit.CheckbookTest.getTransactionAddingNewTForDateA" />
364
+      <item itemvalue="JUnit.CheckbookTest.testGetDebitsManipulatedCheckbook" />
365
+      <item itemvalue="JUnit.CheckbookTest.testToArrayFailV2" />
366
+      <item itemvalue="JUnit.CheckbookTest.testGetCredits" />
367
+      <item itemvalue="JUnit.CheckbookTest.testGetCreditsNone" />
368
+      <item itemvalue="JUnit.CheckbookTest.testGetCreditsafterAdding" />
372 369
     </list>
373 370
     <recent_temporary>
374 371
       <list>
375
-        <item itemvalue="JUnit.CheckbookTest.getTransactionsForPayeeExists" />
376
-        <item itemvalue="JUnit.CheckbookTest.getTransactionAddingNewTForDateA" />
377
-        <item itemvalue="JUnit.CheckbookTest.getTransactionsForPayeeExistsAfterAdd" />
378
-        <item itemvalue="JUnit.CheckbookTest.getTransactionsForPayeeNotExists" />
379
-        <item itemvalue="JUnit.CheckbookTest.getTransactionsForPayeeExists2" />
372
+        <item itemvalue="JUnit.CheckbookTest.testGetCreditsafterAdding" />
373
+        <item itemvalue="JUnit.CheckbookTest.testGetCreditsNone" />
374
+        <item itemvalue="JUnit.CheckbookTest.testGetCredits" />
375
+        <item itemvalue="JUnit.CheckbookTest.testToArrayFailV2" />
376
+        <item itemvalue="JUnit.CheckbookTest.testGetDebitsManipulatedCheckbook" />
380 377
       </list>
381 378
     </recent_temporary>
382 379
   </component>
@@ -391,44 +388,44 @@
391 388
       <option name="presentableId" value="Default" />
392 389
       <updated>1543958631974</updated>
393 390
       <workItem from="1543958633447" duration="3259000" />
394
-      <workItem from="1544046850600" duration="23473000" />
391
+      <workItem from="1544046850600" duration="24772000" />
395 392
     </task>
396 393
     <servers />
397 394
   </component>
398 395
   <component name="TestHistory">
399
-    <history-entry file="CheckbookTest_getTransactionsForPayeeExists2 - 2018.12.06 at 13h 20m 20s.xml">
400
-      <configuration name="CheckbookTest.getTransactionsForPayeeExists2" configurationId="JUnit" />
396
+    <history-entry file="CheckbookTest_getTransactionsForPayeeExistsAfterAdd - 2018.12.06 at 14h 24m 20s.xml">
397
+      <configuration name="CheckbookTest.getTransactionsForPayeeExistsAfterAdd" configurationId="JUnit" />
401 398
     </history-entry>
402
-    <history-entry file="CheckbookTest_getTransactionsForPayeeExists2 - 2018.12.06 at 13h 20m 40s.xml">
403
-      <configuration name="CheckbookTest.getTransactionsForPayeeExists2" configurationId="JUnit" />
399
+    <history-entry file="CheckbookTest_getTransactionsForPayeeExistsAfterAdd - 2018.12.06 at 14h 24m 50s.xml">
400
+      <configuration name="CheckbookTest.getTransactionsForPayeeExistsAfterAdd" configurationId="JUnit" />
404 401
     </history-entry>
405
-    <history-entry file="CheckbookTest_getTransactionsForPayeeExists2 - 2018.12.06 at 13h 20m 56s.xml">
406
-      <configuration name="CheckbookTest.getTransactionsForPayeeExists2" configurationId="JUnit" />
402
+    <history-entry file="CheckbookTest_getTransactionAddingNewTForDateA - 2018.12.06 at 14h 27m 07s.xml">
403
+      <configuration name="CheckbookTest.getTransactionAddingNewTForDateA" configurationId="JUnit" />
407 404
     </history-entry>
408
-    <history-entry file="CheckbookTest_getTransactionsForPayeeNotExists - 2018.12.06 at 13h 24m 02s.xml">
409
-      <configuration name="CheckbookTest.getTransactionsForPayeeNotExists" configurationId="JUnit" />
405
+    <history-entry file="CheckbookTest_getTransactionsForPayeeExists - 2018.12.06 at 14h 31m 23s.xml">
406
+      <configuration name="CheckbookTest.getTransactionsForPayeeExists" configurationId="JUnit" />
410 407
     </history-entry>
411
-    <history-entry file="CheckbookTest_getTransactionsForPayeeNotExists - 2018.12.06 at 13h 24m 22s.xml">
412
-      <configuration name="CheckbookTest.getTransactionsForPayeeNotExists" configurationId="JUnit" />
408
+    <history-entry file="CheckbookTest_testGetDebits - 2018.12.06 at 17h 31m 07s.xml">
409
+      <configuration name="CheckbookTest.testGetDebits" configurationId="JUnit" />
413 410
     </history-entry>
414
-    <history-entry file="CheckbookTest_getTransactionsForPayeeExistsAfterAdd - 2018.12.06 at 13h 26m 25s.xml">
415
-      <configuration name="CheckbookTest.getTransactionsForPayeeExistsAfterAdd" configurationId="JUnit" />
411
+    <history-entry file="CheckbookTest_testGetDebits - 2018.12.06 at 17h 31m 20s.xml">
412
+      <configuration name="CheckbookTest.testGetDebits" configurationId="JUnit" />
416 413
     </history-entry>
417
-    <history-entry file="CheckbookTest_getTransactionsForPayeeExistsAfterAdd - 2018.12.06 at 13h 26m 55s.xml">
418
-      <configuration name="CheckbookTest.getTransactionsForPayeeExistsAfterAdd" configurationId="JUnit" />
414
+    <history-entry file="CheckbookTest_testGetDebits - 2018.12.06 at 17h 32m 48s.xml">
415
+      <configuration name="CheckbookTest.testGetDebits" configurationId="JUnit" />
419 416
     </history-entry>
420
-    <history-entry file="CheckbookTest_getTransactionsForPayeeExistsAfterAdd - 2018.12.06 at 14h 24m 20s.xml">
421
-      <configuration name="CheckbookTest.getTransactionsForPayeeExistsAfterAdd" configurationId="JUnit" />
417
+    <history-entry file="CheckbookTest_testGetDebitsNone - 2018.12.06 at 17h 34m 21s.xml">
418
+      <configuration name="CheckbookTest.testGetDebitsNone" configurationId="JUnit" />
422 419
     </history-entry>
423
-    <history-entry file="CheckbookTest_getTransactionsForPayeeExistsAfterAdd - 2018.12.06 at 14h 24m 50s.xml">
424
-      <configuration name="CheckbookTest.getTransactionsForPayeeExistsAfterAdd" configurationId="JUnit" />
420
+    <history-entry file="CheckbookTest_testGetDebitsManipulatedCheckbook - 2018.12.06 at 17h 35m 23s.xml">
421
+      <configuration name="CheckbookTest.testGetDebitsManipulatedCheckbook" configurationId="JUnit" />
425 422
     </history-entry>
426
-    <history-entry file="CheckbookTest_getTransactionAddingNewTForDateA - 2018.12.06 at 14h 27m 07s.xml">
427
-      <configuration name="CheckbookTest.getTransactionAddingNewTForDateA" configurationId="JUnit" />
423
+    <history-entry file="CheckbookTest_testToArrayFailV2 - 2018.12.06 at 17h 36m 26s.xml">
424
+      <configuration name="CheckbookTest.testToArrayFailV2" configurationId="JUnit" />
428 425
     </history-entry>
429 426
   </component>
430 427
   <component name="TimeTrackingManager">
431
-    <option name="totallyTimeSpent" value="26732000" />
428
+    <option name="totallyTimeSpent" value="28031000" />
432 429
   </component>
433 430
   <component name="ToolWindowManager">
434 431
     <frame x="0" y="23" width="1440" height="877" extended-state="0" />
@@ -450,7 +447,7 @@
450 447
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
451 448
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
452 449
       <window_info anchor="bottom" id="TODO" order="6" />
453
-      <window_info anchor="bottom" id="Terminal" order="7" weight="0.32899868" />
450
+      <window_info anchor="bottom" id="Terminal" order="7" weight="0.32769832" />
454 451
       <window_info anchor="bottom" id="Event Log" order="8" sideWeight="0.5007153" side_tool="true" weight="0.32769832" />
455 452
       <window_info anchor="bottom" id="Version Control" order="9" />
456 453
       <window_info anchor="right" id="Commander" order="0" weight="0.4" />
@@ -584,16 +581,6 @@
584 581
         </state>
585 582
       </provider>
586 583
     </entry>
587
-    <entry file="file://$PROJECT_DIR$/README.md">
588
-      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
589
-        <state split_layout="FIRST">
590
-          <first_editor relative-caret-position="765">
591
-            <caret line="48" lean-forward="true" selection-start-line="48" selection-end-line="48" />
592
-          </first_editor>
593
-          <second_editor />
594
-        </state>
595
-      </provider>
596
-    </entry>
597 584
     <entry file="jar://$MAVEN_REPOSITORY$/junit/junit/4.0/junit-4.0.jar!/org/junit/Assert.class">
598 585
       <provider selected="true" editor-type-id="text-editor">
599 586
         <state relative-caret-position="124">
@@ -614,7 +601,7 @@
614 601
     </entry>
615 602
     <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java">
616 603
       <provider selected="true" editor-type-id="text-editor">
617
-        <state relative-caret-position="185">
604
+        <state relative-caret-position="-279">
618 605
           <caret line="12" column="26" lean-forward="true" selection-start-line="12" selection-start-column="26" selection-end-line="12" selection-end-column="26" />
619 606
           <folding>
620 607
             <element signature="imports" expanded="true" />
@@ -622,10 +609,20 @@
622 609
         </state>
623 610
       </provider>
624 611
     </entry>
612
+    <entry file="file://$PROJECT_DIR$/README.md">
613
+      <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
614
+        <state split_layout="FIRST">
615
+          <first_editor relative-caret-position="283">
616
+            <caret line="48" lean-forward="true" selection-start-line="48" selection-end-line="48" />
617
+          </first_editor>
618
+          <second_editor />
619
+        </state>
620
+      </provider>
621
+    </entry>
625 622
     <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Checkbook.java">
626 623
       <provider selected="true" editor-type-id="text-editor">
627
-        <state relative-caret-position="279">
628
-          <caret line="83" column="16" selection-start-line="83" selection-start-column="16" selection-end-line="83" selection-end-column="16" />
624
+        <state relative-caret-position="-1294">
625
+          <caret line="45" lean-forward="true" selection-start-line="45" selection-end-line="45" />
629 626
           <folding>
630 627
             <element signature="imports" expanded="true" />
631 628
             <element signature="e#1262#1263#0" expanded="true" />
@@ -650,8 +647,8 @@
650 647
     </entry>
651 648
     <entry file="file://$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java">
652 649
       <provider selected="true" editor-type-id="text-editor">
653
-        <state relative-caret-position="-209">
654
-          <caret line="228" column="5" selection-start-line="228" selection-start-column="5" selection-end-line="228" selection-end-column="5" />
650
+        <state relative-caret-position="362">
651
+          <caret line="354" column="94" selection-start-line="354" selection-start-column="94" selection-end-line="354" selection-end-column="94" />
655 652
           <folding>
656 653
             <element signature="imports" expanded="true" />
657 654
           </folding>

+ 31
- 6
Checkbook/src/test/java/CheckbookTest.java Ver arquivo

@@ -2,6 +2,7 @@ import org.junit.Assert;
2 2
 import org.junit.Test;
3 3
 
4 4
 import java.time.LocalDate;
5
+import java.util.Arrays;
5 6
 import java.util.NoSuchElementException;
6 7
 
7 8
 import static org.junit.Assert.*;
@@ -13,7 +14,6 @@ public class CheckbookTest {
13 14
     private final double cashAmount = 500.00;
14 15
     private final double t2Amount = 100.00;
15 16
     private final double t3Amount = 50.00;
16
-    private final double DELTA = 0.0;
17 17
 
18 18
     @org.junit.Before
19 19
     public void setUp(){
@@ -179,7 +179,7 @@ public class CheckbookTest {
179 179
     public void testToArrayFailV2() {
180 180
         Transaction[] arrUnEx = {t1, t2};
181 181
         Transaction[] arr = {t1};
182
-        assertFalse(arr.equals(checkbook.toArray(arrUnEx)));
182
+        assertFalse(Arrays.equals(arr, checkbook.toArray(arrUnEx)));
183 183
     }
184 184
 
185 185
     @Test
@@ -317,31 +317,56 @@ public class CheckbookTest {
317 317
 
318 318
     @Test
319 319
     public void testGetDebits() {
320
+        Transaction d1 = checkbookWithDefault.getCheckbook().get(0);
321
+        Transaction d2 = checkbookWithOwner.getCheckbook().get(0);
320 322
 
323
+        Transaction[] expArr =  {d1, d2};
324
+        checkbookWithDefault.add(d2);
325
+        assertEquals(expArr, checkbookWithDefault.getSpecificTransactions("typee", TransactionType.DEBIT));
326
+
327
+        Transaction[] expArr2 = {d2, d2};
328
+        checkbookWithOwner.add(d2);
329
+        assertEquals(expArr2, checkbookWithOwner.getSpecificTransactions("typee", TransactionType.DEBIT));
321 330
     }
322 331
 
323 332
     @Test
324 333
     public void testGetDebitsNone() {
334
+        Transaction[] arr = {};
335
+
336
+        checkbook.remove(t2);
325 337
 
338
+        assertEquals(arr, checkbook.getSpecificTransactions("typee", TransactionType.DEBIT));
326 339
     }
327 340
 
328 341
     @Test
329
-    public void testGetDebitsAdded() {
342
+    public void testGetDebitsManipulatedCheckbook() {
343
+        Transaction t = new Transaction("foo", new Payee(), TransactionType.DEBIT, 400.00);
344
+        Transaction[] arr = {t};
345
+        checkbook.remove(t2);
346
+        checkbook.add(t);
330 347
 
348
+        assertEquals(arr, checkbook.getSpecificTransactions("typee", TransactionType.DEBIT));
331 349
     }
332 350
 
333 351
     @Test
334 352
     public void testGetCredits() {
335
-
353
+        Transaction[] expArr = {t1, t3};
354
+        assertEquals(expArr, checkbook.getSpecificTransactions("typee", TransactionType.CREDIT));
336 355
     }
337 356
 
338 357
     @Test
339 358
     public void testGetCreditsNone() {
340
-
359
+        Transaction[] expArr = {};
360
+        assertEquals(expArr, checkbookWithDefault.getSpecificTransactions("typee", TransactionType.CREDIT));
361
+        assertEquals(expArr, checkbookWithOwner.getSpecificTransactions("typee", TransactionType.CREDIT));
341 362
     }
342 363
 
343 364
     @Test
344
-    public void testGetCreditsRemoveAndAdd() {
365
+    public void testGetCreditsAfterAdding() {
366
+        Transaction t = new Transaction("bar", new Payee(), TransactionType.CREDIT, 10.00);
367
+        Transaction[] arr = {t};
345 368
 
369
+        checkbookWithOwner.add(t);
370
+        assertEquals(arr, checkbookWithOwner.getSpecificTransactions("typee", TransactionType.CREDIT));
346 371
     }
347 372
 }