Kaynağa Gözat

test methods

Trinh Tong 6 yıl önce
ebeveyn
işleme
784eabb010
2 değiştirilmiş dosya ile 100 ekleme ve 78 silme
  1. 69
    72
      .idea/workspace.xml
  2. 31
    6
      Checkbook/src/test/java/CheckbookTest.java

+ 69
- 72
.idea/workspace.xml Dosyayı Görüntüle

2
 <project version="4">
2
 <project version="4">
3
   <component name="ChangeListManager">
3
   <component name="ChangeListManager">
4
     <list default="true" id="926ad23d-2ddc-41ae-980d-780dcc1811fa" name="Default" comment="">
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
       <change beforePath="$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java" afterDir="false" />
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
     </list>
6
     </list>
10
     <ignored path="$PROJECT_DIR$/Checkbook/target/" />
7
     <ignored path="$PROJECT_DIR$/Checkbook/target/" />
25
       <usages-collector id="statistics.file.types.open">
22
       <usages-collector id="statistics.file.types.open">
26
         <counts>
23
         <counts>
27
           <entry key="CLASS" value="6" />
24
           <entry key="CLASS" value="6" />
28
-          <entry key="JAVA" value="43" />
25
+          <entry key="JAVA" value="44" />
29
           <entry key="Markdown" value="1" />
26
           <entry key="Markdown" value="1" />
30
         </counts>
27
         </counts>
31
       </usages-collector>
28
       </usages-collector>
32
       <usages-collector id="statistics.file.types.edit">
29
       <usages-collector id="statistics.file.types.edit">
33
         <counts>
30
         <counts>
34
-          <entry key="JAVA" value="8937" />
31
+          <entry key="JAVA" value="9750" />
35
           <entry key="Markdown" value="11" />
32
           <entry key="Markdown" value="11" />
36
         </counts>
33
         </counts>
37
       </usages-collector>
34
       </usages-collector>
43
         <entry file="file://$PROJECT_DIR$/README.md">
40
         <entry file="file://$PROJECT_DIR$/README.md">
44
           <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
41
           <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
45
             <state split_layout="FIRST">
42
             <state split_layout="FIRST">
46
-              <first_editor relative-caret-position="765">
43
+              <first_editor relative-caret-position="283">
47
                 <caret line="48" lean-forward="true" selection-start-line="48" selection-end-line="48" />
44
                 <caret line="48" lean-forward="true" selection-start-line="48" selection-end-line="48" />
48
               </first_editor>
45
               </first_editor>
49
               <second_editor />
46
               <second_editor />
54
       <file pinned="false" current-in-tab="false">
51
       <file pinned="false" current-in-tab="false">
55
         <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java">
52
         <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java">
56
           <provider selected="true" editor-type-id="text-editor">
53
           <provider selected="true" editor-type-id="text-editor">
57
-            <state relative-caret-position="185">
54
+            <state relative-caret-position="-279">
58
               <caret line="12" column="26" lean-forward="true" selection-start-line="12" selection-start-column="26" selection-end-line="12" selection-end-column="26" />
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
               <folding>
56
               <folding>
60
                 <element signature="imports" expanded="true" />
57
                 <element signature="imports" expanded="true" />
66
       <file pinned="false" current-in-tab="false">
63
       <file pinned="false" current-in-tab="false">
67
         <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Checkbook.java">
64
         <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Checkbook.java">
68
           <provider selected="true" editor-type-id="text-editor">
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
               <folding>
68
               <folding>
72
                 <element signature="imports" expanded="true" />
69
                 <element signature="imports" expanded="true" />
73
                 <element signature="e#1262#1263#0" expanded="true" />
70
                 <element signature="e#1262#1263#0" expanded="true" />
94
       <file pinned="false" current-in-tab="true">
91
       <file pinned="false" current-in-tab="true">
95
         <entry file="file://$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java">
92
         <entry file="file://$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java">
96
           <provider selected="true" editor-type-id="text-editor">
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
               <folding>
96
               <folding>
100
                 <element signature="imports" expanded="true" />
97
                 <element signature="imports" expanded="true" />
101
               </folding>
98
               </folding>
154
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Account.java" />
151
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Account.java" />
155
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java" />
152
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java" />
156
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Payee.java" />
153
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Payee.java" />
157
-        <option value="$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java" />
158
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Checkbook.java" />
154
         <option value="$PROJECT_DIR$/Checkbook/src/main/java/Checkbook.java" />
155
+        <option value="$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java" />
159
       </list>
156
       </list>
160
     </option>
157
     </option>
161
   </component>
158
   </component>
241
   <component name="PropertiesComponent">
238
   <component name="PropertiesComponent">
242
     <property name="WebServerToolWindowFactoryState" value="false" />
239
     <property name="WebServerToolWindowFactoryState" value="false" />
243
     <property name="aspect.path.notification.shown" value="true" />
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
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
242
     <property name="com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary" value="JUnit4" />
246
     <property name="extract.method.default.visibility" value="private" />
243
     <property name="extract.method.default.visibility" value="private" />
247
     <property name="jdk.selected.JAVA_MODULE" value="1.8" />
244
     <property name="jdk.selected.JAVA_MODULE" value="1.8" />
272
       </list>
269
       </list>
273
     </option>
270
     </option>
274
   </component>
271
   </component>
275
-  <component name="RunManager" selected="JUnit.CheckbookTest.getTransactionsForPayeeExists">
272
+  <component name="RunManager" selected="JUnit.CheckbookTest.testGetCreditsafterAdding">
276
     <configuration default="true" type="Applet" factoryName="Applet">
273
     <configuration default="true" type="Applet" factoryName="Applet">
277
       <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
274
       <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
278
       <method v="2">
275
       <method v="2">
285
         <option name="Make" enabled="true" />
282
         <option name="Make" enabled="true" />
286
       </method>
283
       </method>
287
     </configuration>
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
       <module name="Checkbook" />
286
       <module name="Checkbook" />
290
       <option name="PACKAGE_NAME" value="" />
287
       <option name="PACKAGE_NAME" value="" />
291
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
288
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
292
-      <option name="METHOD_NAME" value="getTransactionAddingNewTForDateA" />
289
+      <option name="METHOD_NAME" value="testGetCredits" />
293
       <option name="TEST_OBJECT" value="method" />
290
       <option name="TEST_OBJECT" value="method" />
294
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
291
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
295
       <method v="2">
292
       <method v="2">
296
         <option name="Make" enabled="true" />
293
         <option name="Make" enabled="true" />
297
       </method>
294
       </method>
298
     </configuration>
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
       <module name="Checkbook" />
297
       <module name="Checkbook" />
301
       <option name="PACKAGE_NAME" value="" />
298
       <option name="PACKAGE_NAME" value="" />
302
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
299
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
303
-      <option name="METHOD_NAME" value="getTransactionsForPayeeExists" />
300
+      <option name="METHOD_NAME" value="testGetCreditsNone" />
304
       <option name="TEST_OBJECT" value="method" />
301
       <option name="TEST_OBJECT" value="method" />
305
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
302
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
306
       <method v="2">
303
       <method v="2">
307
         <option name="Make" enabled="true" />
304
         <option name="Make" enabled="true" />
308
       </method>
305
       </method>
309
     </configuration>
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
       <module name="Checkbook" />
308
       <module name="Checkbook" />
312
       <option name="PACKAGE_NAME" value="" />
309
       <option name="PACKAGE_NAME" value="" />
313
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
310
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
314
-      <option name="METHOD_NAME" value="getTransactionsForPayeeExists2" />
311
+      <option name="METHOD_NAME" value="testGetCreditsafterAdding" />
315
       <option name="TEST_OBJECT" value="method" />
312
       <option name="TEST_OBJECT" value="method" />
316
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
313
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
317
       <method v="2">
314
       <method v="2">
318
         <option name="Make" enabled="true" />
315
         <option name="Make" enabled="true" />
319
       </method>
316
       </method>
320
     </configuration>
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
       <module name="Checkbook" />
319
       <module name="Checkbook" />
323
       <option name="PACKAGE_NAME" value="" />
320
       <option name="PACKAGE_NAME" value="" />
324
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
321
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
325
-      <option name="METHOD_NAME" value="getTransactionsForPayeeExistsAfterAdd" />
322
+      <option name="METHOD_NAME" value="testGetDebitsManipulatedCheckbook" />
326
       <option name="TEST_OBJECT" value="method" />
323
       <option name="TEST_OBJECT" value="method" />
327
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
324
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
328
       <method v="2">
325
       <method v="2">
329
         <option name="Make" enabled="true" />
326
         <option name="Make" enabled="true" />
330
       </method>
327
       </method>
331
     </configuration>
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
       <module name="Checkbook" />
330
       <module name="Checkbook" />
334
       <option name="PACKAGE_NAME" value="" />
331
       <option name="PACKAGE_NAME" value="" />
335
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
332
       <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
336
-      <option name="METHOD_NAME" value="getTransactionsForPayeeNotExists" />
333
+      <option name="METHOD_NAME" value="testToArrayFailV2" />
337
       <option name="TEST_OBJECT" value="method" />
334
       <option name="TEST_OBJECT" value="method" />
338
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
335
       <option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
339
       <method v="2">
336
       <method v="2">
364
       </method>
361
       </method>
365
     </configuration>
362
     </configuration>
366
     <list>
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
     </list>
369
     </list>
373
     <recent_temporary>
370
     <recent_temporary>
374
       <list>
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
       </list>
377
       </list>
381
     </recent_temporary>
378
     </recent_temporary>
382
   </component>
379
   </component>
391
       <option name="presentableId" value="Default" />
388
       <option name="presentableId" value="Default" />
392
       <updated>1543958631974</updated>
389
       <updated>1543958631974</updated>
393
       <workItem from="1543958633447" duration="3259000" />
390
       <workItem from="1543958633447" duration="3259000" />
394
-      <workItem from="1544046850600" duration="23473000" />
391
+      <workItem from="1544046850600" duration="24772000" />
395
     </task>
392
     </task>
396
     <servers />
393
     <servers />
397
   </component>
394
   </component>
398
   <component name="TestHistory">
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
     </history-entry>
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
     </history-entry>
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
     </history-entry>
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
     </history-entry>
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
     </history-entry>
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
     </history-entry>
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
     </history-entry>
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
     </history-entry>
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
     </history-entry>
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
     </history-entry>
425
     </history-entry>
429
   </component>
426
   </component>
430
   <component name="TimeTrackingManager">
427
   <component name="TimeTrackingManager">
431
-    <option name="totallyTimeSpent" value="26732000" />
428
+    <option name="totallyTimeSpent" value="28031000" />
432
   </component>
429
   </component>
433
   <component name="ToolWindowManager">
430
   <component name="ToolWindowManager">
434
     <frame x="0" y="23" width="1440" height="877" extended-state="0" />
431
     <frame x="0" y="23" width="1440" height="877" extended-state="0" />
450
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
447
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
451
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
448
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
452
       <window_info anchor="bottom" id="TODO" order="6" />
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
       <window_info anchor="bottom" id="Event Log" order="8" sideWeight="0.5007153" side_tool="true" weight="0.32769832" />
451
       <window_info anchor="bottom" id="Event Log" order="8" sideWeight="0.5007153" side_tool="true" weight="0.32769832" />
455
       <window_info anchor="bottom" id="Version Control" order="9" />
452
       <window_info anchor="bottom" id="Version Control" order="9" />
456
       <window_info anchor="right" id="Commander" order="0" weight="0.4" />
453
       <window_info anchor="right" id="Commander" order="0" weight="0.4" />
584
         </state>
581
         </state>
585
       </provider>
582
       </provider>
586
     </entry>
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
     <entry file="jar://$MAVEN_REPOSITORY$/junit/junit/4.0/junit-4.0.jar!/org/junit/Assert.class">
584
     <entry file="jar://$MAVEN_REPOSITORY$/junit/junit/4.0/junit-4.0.jar!/org/junit/Assert.class">
598
       <provider selected="true" editor-type-id="text-editor">
585
       <provider selected="true" editor-type-id="text-editor">
599
         <state relative-caret-position="124">
586
         <state relative-caret-position="124">
614
     </entry>
601
     </entry>
615
     <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java">
602
     <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Transaction.java">
616
       <provider selected="true" editor-type-id="text-editor">
603
       <provider selected="true" editor-type-id="text-editor">
617
-        <state relative-caret-position="185">
604
+        <state relative-caret-position="-279">
618
           <caret line="12" column="26" lean-forward="true" selection-start-line="12" selection-start-column="26" selection-end-line="12" selection-end-column="26" />
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
           <folding>
606
           <folding>
620
             <element signature="imports" expanded="true" />
607
             <element signature="imports" expanded="true" />
622
         </state>
609
         </state>
623
       </provider>
610
       </provider>
624
     </entry>
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
     <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Checkbook.java">
622
     <entry file="file://$PROJECT_DIR$/Checkbook/src/main/java/Checkbook.java">
626
       <provider selected="true" editor-type-id="text-editor">
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
           <folding>
626
           <folding>
630
             <element signature="imports" expanded="true" />
627
             <element signature="imports" expanded="true" />
631
             <element signature="e#1262#1263#0" expanded="true" />
628
             <element signature="e#1262#1263#0" expanded="true" />
650
     </entry>
647
     </entry>
651
     <entry file="file://$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java">
648
     <entry file="file://$PROJECT_DIR$/Checkbook/src/test/java/CheckbookTest.java">
652
       <provider selected="true" editor-type-id="text-editor">
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
           <folding>
652
           <folding>
656
             <element signature="imports" expanded="true" />
653
             <element signature="imports" expanded="true" />
657
           </folding>
654
           </folding>

+ 31
- 6
Checkbook/src/test/java/CheckbookTest.java Dosyayı Görüntüle

2
 import org.junit.Test;
2
 import org.junit.Test;
3
 
3
 
4
 import java.time.LocalDate;
4
 import java.time.LocalDate;
5
+import java.util.Arrays;
5
 import java.util.NoSuchElementException;
6
 import java.util.NoSuchElementException;
6
 
7
 
7
 import static org.junit.Assert.*;
8
 import static org.junit.Assert.*;
13
     private final double cashAmount = 500.00;
14
     private final double cashAmount = 500.00;
14
     private final double t2Amount = 100.00;
15
     private final double t2Amount = 100.00;
15
     private final double t3Amount = 50.00;
16
     private final double t3Amount = 50.00;
16
-    private final double DELTA = 0.0;
17
 
17
 
18
     @org.junit.Before
18
     @org.junit.Before
19
     public void setUp(){
19
     public void setUp(){
179
     public void testToArrayFailV2() {
179
     public void testToArrayFailV2() {
180
         Transaction[] arrUnEx = {t1, t2};
180
         Transaction[] arrUnEx = {t1, t2};
181
         Transaction[] arr = {t1};
181
         Transaction[] arr = {t1};
182
-        assertFalse(arr.equals(checkbook.toArray(arrUnEx)));
182
+        assertFalse(Arrays.equals(arr, checkbook.toArray(arrUnEx)));
183
     }
183
     }
184
 
184
 
185
     @Test
185
     @Test
317
 
317
 
318
     @Test
318
     @Test
319
     public void testGetDebits() {
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
     @Test
332
     @Test
324
     public void testGetDebitsNone() {
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
     @Test
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
     @Test
351
     @Test
334
     public void testGetCredits() {
352
     public void testGetCredits() {
335
-
353
+        Transaction[] expArr = {t1, t3};
354
+        assertEquals(expArr, checkbook.getSpecificTransactions("typee", TransactionType.CREDIT));
336
     }
355
     }
337
 
356
 
338
     @Test
357
     @Test
339
     public void testGetCreditsNone() {
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
     @Test
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
 }