ThuyKhong 6 yıl önce
ebeveyn
işleme
b77bdfd978

+ 16
- 0
Checkbook/.idea/compiler.xml Dosyayı Görüntüle

@@ -0,0 +1,16 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="CompilerConfiguration">
4
+    <annotationProcessing>
5
+      <profile name="Maven default annotation processors profile" enabled="true">
6
+        <sourceOutputDir name="target/generated-sources/annotations" />
7
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
8
+        <outputRelativeToContentRoot value="true" />
9
+        <module name="Checkbook" />
10
+      </profile>
11
+    </annotationProcessing>
12
+    <bytecodeTargetLevel>
13
+      <module name="Checkbook" target="1.8" />
14
+    </bytecodeTargetLevel>
15
+  </component>
16
+</project>

+ 13
- 0
Checkbook/.idea/libraries/Maven__junit_junit_4_12.xml Dosyayı Görüntüle

@@ -0,0 +1,13 @@
1
+<component name="libraryTable">
2
+  <library name="Maven: junit:junit:4.12">
3
+    <CLASSES>
4
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" />
5
+    </CLASSES>
6
+    <JAVADOC>
7
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-javadoc.jar!/" />
8
+    </JAVADOC>
9
+    <SOURCES>
10
+      <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-sources.jar!/" />
11
+    </SOURCES>
12
+  </library>
13
+</component>

+ 13
- 0
Checkbook/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml Dosyayı Görüntüle

@@ -0,0 +1,13 @@
1
+<component name="libraryTable">
2
+  <library name="Maven: org.hamcrest:hamcrest-core:1.3">
3
+    <CLASSES>
4
+      <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
5
+    </CLASSES>
6
+    <JAVADOC>
7
+      <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar!/" />
8
+    </JAVADOC>
9
+    <SOURCES>
10
+      <root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar!/" />
11
+    </SOURCES>
12
+  </library>
13
+</component>

+ 13
- 0
Checkbook/.idea/misc.xml Dosyayı Görüntüle

@@ -0,0 +1,13 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="MavenProjectsManager">
4
+    <option name="originalFiles">
5
+      <list>
6
+        <option value="$PROJECT_DIR$/pom.xml" />
7
+      </list>
8
+    </option>
9
+  </component>
10
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
11
+    <output url="file://$PROJECT_DIR$/classes" />
12
+  </component>
13
+</project>

+ 8
- 0
Checkbook/.idea/modules.xml Dosyayı Görüntüle

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ProjectModuleManager">
4
+    <modules>
5
+      <module fileurl="file://$PROJECT_DIR$/Checkbook.iml" filepath="$PROJECT_DIR$/Checkbook.iml" />
6
+    </modules>
7
+  </component>
8
+</project>

+ 6
- 0
Checkbook/.idea/vcs.xml Dosyayı Görüntüle

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="VcsDirectoryMappings">
4
+    <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
5
+  </component>
6
+</project>

+ 579
- 0
Checkbook/.idea/workspace.xml Dosyayı Görüntüle

@@ -0,0 +1,579 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="7da73aa2-1045-4ccb-a689-1736337d337e" name="Default Changelist" comment="">
5
+      <change afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
6
+      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__junit_junit_4_12.xml" afterDir="false" />
7
+      <change afterPath="$PROJECT_DIR$/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml" afterDir="false" />
8
+      <change afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
9
+      <change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
10
+      <change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
11
+      <change afterPath="$PROJECT_DIR$/src/test/java/TestGenericAccount.java" afterDir="false" />
12
+      <change beforePath="$PROJECT_DIR$/Checkbook.iml" beforeDir="false" afterPath="$PROJECT_DIR$/Checkbook.iml" afterDir="false" />
13
+      <change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
14
+      <change beforePath="$PROJECT_DIR$/src/main/java/Checkbook.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Checkbook.java" afterDir="false" />
15
+      <change beforePath="$PROJECT_DIR$/src/main/java/GenericAccount.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/GenericAccount.java" afterDir="false" />
16
+      <change beforePath="$PROJECT_DIR$/src/main/java/Payee.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Payee.java" afterDir="false" />
17
+      <change beforePath="$PROJECT_DIR$/src/main/java/Transaction.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Transaction.java" afterDir="false" />
18
+      <change beforePath="$PROJECT_DIR$/src/test/java/CheckbookTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/CheckbookTest.java" afterDir="false" />
19
+    </list>
20
+    <ignored path="$PROJECT_DIR$/target/" />
21
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
22
+    <option name="SHOW_DIALOG" value="false" />
23
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
24
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
25
+    <option name="LAST_RESOLUTION" value="IGNORE" />
26
+  </component>
27
+  <component name="FUSProjectUsageTrigger">
28
+    <session id="915478632">
29
+      <usages-collector id="statistics.lifecycle.project">
30
+        <counts>
31
+          <entry key="project.open.time.1" value="1" />
32
+          <entry key="project.opened" value="1" />
33
+        </counts>
34
+      </usages-collector>
35
+      <usages-collector id="statistics.file.extensions.open">
36
+        <counts>
37
+          <entry key="java" value="8" />
38
+          <entry key="xml" value="1" />
39
+        </counts>
40
+      </usages-collector>
41
+      <usages-collector id="statistics.file.types.open">
42
+        <counts>
43
+          <entry key="JAVA" value="8" />
44
+          <entry key="XML" value="1" />
45
+        </counts>
46
+      </usages-collector>
47
+      <usages-collector id="statistics.file.extensions.edit">
48
+        <counts>
49
+          <entry key="java" value="6365" />
50
+          <entry key="xml" value="2" />
51
+        </counts>
52
+      </usages-collector>
53
+      <usages-collector id="statistics.file.types.edit">
54
+        <counts>
55
+          <entry key="JAVA" value="6365" />
56
+          <entry key="XML" value="2" />
57
+        </counts>
58
+      </usages-collector>
59
+    </session>
60
+  </component>
61
+  <component name="FileEditorManager">
62
+    <leaf>
63
+      <file pinned="false" current-in-tab="false">
64
+        <entry file="file://$PROJECT_DIR$/src/main/java/AccountBook.java">
65
+          <provider selected="true" editor-type-id="text-editor">
66
+            <state relative-caret-position="180">
67
+              <caret line="12" selection-start-line="12" selection-end-line="12" />
68
+            </state>
69
+          </provider>
70
+        </entry>
71
+      </file>
72
+      <file pinned="false" current-in-tab="false">
73
+        <entry file="file://$PROJECT_DIR$/src/main/java/Checkbook.java">
74
+          <provider selected="true" editor-type-id="text-editor">
75
+            <state relative-caret-position="231">
76
+              <caret line="100" column="13" lean-forward="true" selection-start-line="100" selection-start-column="13" selection-end-line="100" selection-end-column="13" />
77
+              <folding>
78
+                <element signature="imports" expanded="true" />
79
+                <element signature="e#280#281#0" expanded="true" />
80
+                <element signature="e#330#331#0" expanded="true" />
81
+                <element signature="e#501#502#0" expanded="true" />
82
+                <element signature="e#534#535#0" expanded="true" />
83
+                <element signature="e#662#663#0" expanded="true" />
84
+                <element signature="e#693#694#0" expanded="true" />
85
+                <element signature="e#759#760#0" expanded="true" />
86
+                <element signature="e#785#786#0" expanded="true" />
87
+                <element signature="e#3845#3846#0" expanded="true" />
88
+                <element signature="e#3869#3870#0" expanded="true" />
89
+              </folding>
90
+            </state>
91
+          </provider>
92
+        </entry>
93
+      </file>
94
+      <file pinned="false" current-in-tab="true">
95
+        <entry file="file://$PROJECT_DIR$/src/test/java/CheckbookTest.java">
96
+          <provider selected="true" editor-type-id="text-editor">
97
+            <state relative-caret-position="113">
98
+              <caret line="173" column="82" selection-start-line="173" selection-start-column="82" selection-end-line="173" selection-end-column="82" />
99
+              <folding>
100
+                <element signature="imports" expanded="true" />
101
+                <element signature="e#779#780#0" expanded="true" />
102
+                <element signature="e#803#804#0" expanded="true" />
103
+                <element signature="e#1028#1029#0" expanded="true" />
104
+                <element signature="e#1063#1064#0" expanded="true" />
105
+                <element signature="e#1258#1259#0" expanded="true" />
106
+                <element signature="e#1294#1295#0" expanded="true" />
107
+              </folding>
108
+            </state>
109
+          </provider>
110
+        </entry>
111
+      </file>
112
+      <file pinned="false" current-in-tab="false">
113
+        <entry file="file://$PROJECT_DIR$/src/main/java/Payee.java">
114
+          <provider selected="true" editor-type-id="text-editor">
115
+            <state relative-caret-position="90">
116
+              <caret line="6" column="76" selection-start-line="6" selection-start-column="76" selection-end-line="6" selection-end-column="76" />
117
+            </state>
118
+          </provider>
119
+        </entry>
120
+      </file>
121
+      <file pinned="false" current-in-tab="false">
122
+        <entry file="file://$PROJECT_DIR$/src/main/java/GenericAccount.java">
123
+          <provider selected="true" editor-type-id="text-editor">
124
+            <state relative-caret-position="767">
125
+              <caret line="53" column="5" lean-forward="true" selection-start-line="53" selection-start-column="5" selection-end-line="53" selection-end-column="5" />
126
+              <folding>
127
+                <element signature="imports" expanded="true" />
128
+                <element signature="e#613#614#0" expanded="true" />
129
+                <element signature="e#641#642#0" expanded="true" />
130
+                <element signature="e#682#683#0" expanded="true" />
131
+                <element signature="e#716#717#0" expanded="true" />
132
+                <element signature="e#750#751#0" expanded="true" />
133
+                <element signature="e#780#781#0" expanded="true" />
134
+                <element signature="e#826#827#0" expanded="true" />
135
+                <element signature="e#864#865#0" expanded="true" />
136
+                <element signature="e#905#906#0" expanded="true" />
137
+                <element signature="e#941#942#0" expanded="true" />
138
+                <element signature="e#1000#1001#0" expanded="true" />
139
+                <element signature="e#1050#1051#0" expanded="true" />
140
+                <element signature="e#1081#1082#0" expanded="true" />
141
+                <element signature="e#1108#1109#0" expanded="true" />
142
+                <element signature="e#1148#1149#0" expanded="true" />
143
+                <element signature="e#1180#1181#0" expanded="true" />
144
+              </folding>
145
+            </state>
146
+          </provider>
147
+        </entry>
148
+      </file>
149
+      <file pinned="false" current-in-tab="false">
150
+        <entry file="file://$PROJECT_DIR$/src/test/java/TestGenericAccount.java">
151
+          <provider selected="true" editor-type-id="text-editor">
152
+            <state relative-caret-position="169">
153
+              <caret line="18" column="59" selection-start-line="18" selection-start-column="59" selection-end-line="18" selection-end-column="59" />
154
+              <folding>
155
+                <element signature="imports" expanded="true" />
156
+              </folding>
157
+            </state>
158
+          </provider>
159
+        </entry>
160
+      </file>
161
+      <file pinned="false" current-in-tab="false">
162
+        <entry file="file://$PROJECT_DIR$/src/main/java/TransactionType.java">
163
+          <provider selected="true" editor-type-id="text-editor">
164
+            <state relative-caret-position="15">
165
+              <caret line="1" column="12" selection-start-line="1" selection-start-column="12" selection-end-line="1" selection-end-column="12" />
166
+            </state>
167
+          </provider>
168
+        </entry>
169
+      </file>
170
+      <file pinned="false" current-in-tab="false">
171
+        <entry file="file://$PROJECT_DIR$/src/main/java/Transaction.java">
172
+          <provider selected="true" editor-type-id="text-editor">
173
+            <state relative-caret-position="225">
174
+              <caret line="16" column="5" selection-start-line="16" selection-start-column="5" selection-end-line="16" selection-end-column="5" />
175
+            </state>
176
+          </provider>
177
+        </entry>
178
+      </file>
179
+    </leaf>
180
+  </component>
181
+  <component name="FileTemplateManagerImpl">
182
+    <option name="RECENT_TEMPLATES">
183
+      <list>
184
+        <option value="Class" />
185
+      </list>
186
+    </option>
187
+  </component>
188
+  <component name="Git.Settings">
189
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
190
+  </component>
191
+  <component name="IdeDocumentHistory">
192
+    <option name="CHANGED_PATHS">
193
+      <list>
194
+        <option value="$PROJECT_DIR$/pom.xml" />
195
+        <option value="$PROJECT_DIR$/src/main/java/Transaction.java" />
196
+        <option value="$PROJECT_DIR$/src/main/java/GenericAccount.java" />
197
+        <option value="$PROJECT_DIR$/src/main/java/Payee.java" />
198
+        <option value="$PROJECT_DIR$/src/test/java/TestGenericAccount.java" />
199
+        <option value="$PROJECT_DIR$/src/main/java/Checkbook.java" />
200
+        <option value="$PROJECT_DIR$/src/test/java/CheckbookTest.java" />
201
+      </list>
202
+    </option>
203
+  </component>
204
+  <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
205
+  <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
206
+  <component name="JsGulpfileManager">
207
+    <detection-done>true</detection-done>
208
+    <sorting>DEFINITION_ORDER</sorting>
209
+  </component>
210
+  <component name="MavenImportPreferences">
211
+    <option name="importingSettings">
212
+      <MavenImportingSettings>
213
+        <option name="importAutomatically" value="true" />
214
+      </MavenImportingSettings>
215
+    </option>
216
+  </component>
217
+  <component name="ProjectFrameBounds">
218
+    <option name="x" value="235" />
219
+    <option name="y" value="24" />
220
+    <option name="width" value="1398" />
221
+    <option name="height" value="801" />
222
+  </component>
223
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true">
224
+    <ConfirmationsSetting value="2" id="Add" />
225
+  </component>
226
+  <component name="ProjectView">
227
+    <navigator proportions="" version="1">
228
+      <foldersAlwaysOnTop value="true" />
229
+    </navigator>
230
+    <panes>
231
+      <pane id="Scope" />
232
+      <pane id="ProjectPane">
233
+        <subPane>
234
+          <expand>
235
+            <path>
236
+              <item name="Checkbook" type="b2602c69:ProjectViewProjectNode" />
237
+              <item name="Checkbook" type="462c0819:PsiDirectoryNode" />
238
+            </path>
239
+            <path>
240
+              <item name="Checkbook" type="b2602c69:ProjectViewProjectNode" />
241
+              <item name="Checkbook" type="462c0819:PsiDirectoryNode" />
242
+              <item name="src" type="462c0819:PsiDirectoryNode" />
243
+            </path>
244
+            <path>
245
+              <item name="Checkbook" type="b2602c69:ProjectViewProjectNode" />
246
+              <item name="Checkbook" type="462c0819:PsiDirectoryNode" />
247
+              <item name="src" type="462c0819:PsiDirectoryNode" />
248
+              <item name="main" type="462c0819:PsiDirectoryNode" />
249
+            </path>
250
+            <path>
251
+              <item name="Checkbook" type="b2602c69:ProjectViewProjectNode" />
252
+              <item name="Checkbook" type="462c0819:PsiDirectoryNode" />
253
+              <item name="src" type="462c0819:PsiDirectoryNode" />
254
+              <item name="main" type="462c0819:PsiDirectoryNode" />
255
+              <item name="java" type="462c0819:PsiDirectoryNode" />
256
+            </path>
257
+            <path>
258
+              <item name="Checkbook" type="b2602c69:ProjectViewProjectNode" />
259
+              <item name="Checkbook" type="462c0819:PsiDirectoryNode" />
260
+              <item name="src" type="462c0819:PsiDirectoryNode" />
261
+              <item name="test" type="462c0819:PsiDirectoryNode" />
262
+            </path>
263
+            <path>
264
+              <item name="Checkbook" type="b2602c69:ProjectViewProjectNode" />
265
+              <item name="Checkbook" type="462c0819:PsiDirectoryNode" />
266
+              <item name="src" type="462c0819:PsiDirectoryNode" />
267
+              <item name="test" type="462c0819:PsiDirectoryNode" />
268
+              <item name="java" type="462c0819:PsiDirectoryNode" />
269
+            </path>
270
+          </expand>
271
+          <select />
272
+        </subPane>
273
+      </pane>
274
+      <pane id="PackagesPane" />
275
+    </panes>
276
+  </component>
277
+  <component name="PropertiesComponent">
278
+    <property name="WebServerToolWindowFactoryState" value="false" />
279
+    <property name="aspect.path.notification.shown" value="true" />
280
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544403772342" />
281
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
282
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
283
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
284
+  </component>
285
+  <component name="RunDashboard">
286
+    <option name="ruleStates">
287
+      <list>
288
+        <RuleState>
289
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
290
+        </RuleState>
291
+        <RuleState>
292
+          <option name="name" value="StatusDashboardGroupingRule" />
293
+        </RuleState>
294
+      </list>
295
+    </option>
296
+  </component>
297
+  <component name="RunManager" selected="JUnit.CheckbookTest.testgetTransactionsForDate1">
298
+    <configuration name="CheckbookTest.testGetAllDebitTransactions1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
299
+      <module name="Checkbook" />
300
+      <option name="PACKAGE_NAME" value="" />
301
+      <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
302
+      <option name="METHOD_NAME" value="testGetAllDebitTransactions1" />
303
+      <option name="TEST_OBJECT" value="method" />
304
+      <method v="2">
305
+        <option name="Make" enabled="true" />
306
+      </method>
307
+    </configuration>
308
+    <configuration name="CheckbookTest.testGetAllDebitTransactions2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
309
+      <module name="Checkbook" />
310
+      <option name="PACKAGE_NAME" value="" />
311
+      <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
312
+      <option name="METHOD_NAME" value="testGetAllDebitTransactions2" />
313
+      <option name="TEST_OBJECT" value="method" />
314
+      <method v="2">
315
+        <option name="Make" enabled="true" />
316
+      </method>
317
+    </configuration>
318
+    <configuration name="CheckbookTest.testGetAllTransactionsForPayee1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
319
+      <module name="Checkbook" />
320
+      <option name="PACKAGE_NAME" value="" />
321
+      <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
322
+      <option name="METHOD_NAME" value="testGetAllTransactionsForPayee1" />
323
+      <option name="TEST_OBJECT" value="method" />
324
+      <method v="2">
325
+        <option name="Make" enabled="true" />
326
+      </method>
327
+    </configuration>
328
+    <configuration name="CheckbookTest.testGetAllTransactionsForPayee2" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
329
+      <module name="Checkbook" />
330
+      <option name="PACKAGE_NAME" value="" />
331
+      <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
332
+      <option name="METHOD_NAME" value="testGetAllTransactionsForPayee2" />
333
+      <option name="TEST_OBJECT" value="method" />
334
+      <method v="2">
335
+        <option name="Make" enabled="true" />
336
+      </method>
337
+    </configuration>
338
+    <configuration name="CheckbookTest.testgetTransactionsForDate1" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
339
+      <module name="Checkbook" />
340
+      <option name="PACKAGE_NAME" value="" />
341
+      <option name="MAIN_CLASS_NAME" value="CheckbookTest" />
342
+      <option name="METHOD_NAME" value="testgetTransactionsForDate1" />
343
+      <option name="TEST_OBJECT" value="method" />
344
+      <method v="2">
345
+        <option name="Make" enabled="true" />
346
+      </method>
347
+    </configuration>
348
+    <list>
349
+      <item itemvalue="JUnit.CheckbookTest.testGetAllTransactionsForPayee2" />
350
+      <item itemvalue="JUnit.CheckbookTest.testGetAllDebitTransactions1" />
351
+      <item itemvalue="JUnit.CheckbookTest.testGetAllDebitTransactions2" />
352
+      <item itemvalue="JUnit.CheckbookTest.testGetAllTransactionsForPayee1" />
353
+      <item itemvalue="JUnit.CheckbookTest.testgetTransactionsForDate1" />
354
+    </list>
355
+    <recent_temporary>
356
+      <list>
357
+        <item itemvalue="JUnit.CheckbookTest.testgetTransactionsForDate1" />
358
+        <item itemvalue="JUnit.CheckbookTest.testGetAllTransactionsForPayee1" />
359
+        <item itemvalue="JUnit.CheckbookTest.testGetAllDebitTransactions2" />
360
+        <item itemvalue="JUnit.CheckbookTest.testGetAllDebitTransactions1" />
361
+        <item itemvalue="JUnit.CheckbookTest.testGetAllTransactionsForPayee2" />
362
+      </list>
363
+    </recent_temporary>
364
+  </component>
365
+  <component name="SvnConfiguration">
366
+    <configuration />
367
+  </component>
368
+  <component name="TaskManager">
369
+    <task active="true" id="Default" summary="Default task">
370
+      <changelist id="7da73aa2-1045-4ccb-a689-1736337d337e" name="Default Changelist" comment="" />
371
+      <created>1544210149046</created>
372
+      <option name="number" value="Default" />
373
+      <option name="presentableId" value="Default" />
374
+      <updated>1544210149046</updated>
375
+      <workItem from="1544210150774" duration="20249000" />
376
+    </task>
377
+    <servers />
378
+  </component>
379
+  <component name="TestHistory">
380
+    <history-entry file="CheckbookTest_testGetAllTransactionsForPayee1 - 2018.12.09 at 19h 48m 45s.xml">
381
+      <configuration name="CheckbookTest.testGetAllTransactionsForPayee1" configurationId="JUnit" />
382
+    </history-entry>
383
+    <history-entry file="CheckbookTest_testGetAllTransactionsForPayee1 - 2018.12.09 at 19h 50m 29s.xml">
384
+      <configuration name="CheckbookTest.testGetAllTransactionsForPayee1" configurationId="JUnit" />
385
+    </history-entry>
386
+    <history-entry file="CheckbookTest_testGetAllTransactionsForPayee3 - 2018.12.09 at 19h 50m 40s.xml">
387
+      <configuration name="CheckbookTest.testGetAllTransactionsForPayee3" configurationId="JUnit" />
388
+    </history-entry>
389
+    <history-entry file="CheckbookTest_testgetTransactionsForDate1 - 2018.12.09 at 19h 55m 04s.xml">
390
+      <configuration name="CheckbookTest.testgetTransactionsForDate1" configurationId="JUnit" />
391
+    </history-entry>
392
+    <history-entry file="CheckbookTest_testGetAllTransactionsForPayee3 - 2018.12.09 at 19h 55m 12s.xml">
393
+      <configuration name="CheckbookTest.testGetAllTransactionsForPayee3" configurationId="JUnit" />
394
+    </history-entry>
395
+    <history-entry file="CheckbookTest_testGetAllTransactionsForPayee2 - 2018.12.09 at 19h 55m 28s.xml">
396
+      <configuration name="CheckbookTest.testGetAllTransactionsForPayee2" configurationId="JUnit" />
397
+    </history-entry>
398
+    <history-entry file="CheckbookTest_testGetAllDebitTransactions1 - 2018.12.09 at 19h 55m 42s.xml">
399
+      <configuration name="CheckbookTest.testGetAllDebitTransactions1" configurationId="JUnit" />
400
+    </history-entry>
401
+    <history-entry file="CheckbookTest_testGetAllDebitTransactions2 - 2018.12.09 at 19h 55m 54s.xml">
402
+      <configuration name="CheckbookTest.testGetAllDebitTransactions2" configurationId="JUnit" />
403
+    </history-entry>
404
+    <history-entry file="CheckbookTest_testGetAllTransactionsForPayee1 - 2018.12.09 at 19h 56m 47s.xml">
405
+      <configuration name="CheckbookTest.testGetAllTransactionsForPayee1" configurationId="JUnit" />
406
+    </history-entry>
407
+    <history-entry file="CheckbookTest_testGetAllTransactionsForPayee1 - 2018.12.09 at 20h 00m 32s.xml">
408
+      <configuration name="CheckbookTest.testGetAllTransactionsForPayee1" configurationId="JUnit" />
409
+    </history-entry>
410
+  </component>
411
+  <component name="TimeTrackingManager">
412
+    <option name="totallyTimeSpent" value="20249000" />
413
+  </component>
414
+  <component name="ToolWindowManager">
415
+    <frame x="336" y="263" width="1398" height="801" extended-state="0" />
416
+    <editor active="true" />
417
+    <layout>
418
+      <window_info id="Image Layers" />
419
+      <window_info id="Designer" />
420
+      <window_info id="UI Designer" />
421
+      <window_info id="Capture Tool" />
422
+      <window_info id="Favorites" side_tool="true" />
423
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.15707965" />
424
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
425
+      <window_info anchor="bottom" id="Messages" weight="0.32944608" />
426
+      <window_info anchor="bottom" id="Database Changes" show_stripe_button="false" />
427
+      <window_info anchor="bottom" id="Version Control" show_stripe_button="false" />
428
+      <window_info anchor="bottom" id="Terminal" />
429
+      <window_info anchor="bottom" id="Event Log" side_tool="true" />
430
+      <window_info anchor="bottom" id="Message" order="0" />
431
+      <window_info anchor="bottom" id="Find" order="1" />
432
+      <window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.32944608" />
433
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.39941692" />
434
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
435
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
436
+      <window_info anchor="bottom" id="TODO" order="6" />
437
+      <window_info anchor="right" id="Palette" />
438
+      <window_info anchor="right" id="Theme Preview" />
439
+      <window_info anchor="right" id="Capture Analysis" />
440
+      <window_info anchor="right" id="Palette&#9;" />
441
+      <window_info anchor="right" id="Database" />
442
+      <window_info anchor="right" id="Maven Projects" />
443
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
444
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
445
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
446
+    </layout>
447
+  </component>
448
+  <component name="TypeScriptGeneratedFilesManager">
449
+    <option name="version" value="1" />
450
+  </component>
451
+  <component name="VcsContentAnnotationSettings">
452
+    <option name="myLimit" value="2678400000" />
453
+  </component>
454
+  <component name="editorHistoryManager">
455
+    <entry file="file://$PROJECT_DIR$/src/main/java/AccountBook.java">
456
+      <provider selected="true" editor-type-id="text-editor">
457
+        <state relative-caret-position="180">
458
+          <caret line="12" selection-start-line="12" selection-end-line="12" />
459
+        </state>
460
+      </provider>
461
+    </entry>
462
+    <entry file="file://$PROJECT_DIR$/pom.xml">
463
+      <provider selected="true" editor-type-id="text-editor">
464
+        <state relative-caret-position="337">
465
+          <caret line="27" column="19" selection-start-line="27" selection-start-column="19" selection-end-line="27" selection-end-column="19" />
466
+        </state>
467
+      </provider>
468
+    </entry>
469
+    <entry file="file://$PROJECT_DIR$/src/main/java/TransactionType.java">
470
+      <provider selected="true" editor-type-id="text-editor">
471
+        <state relative-caret-position="15">
472
+          <caret line="1" column="12" selection-start-line="1" selection-start-column="12" selection-end-line="1" selection-end-column="12" />
473
+        </state>
474
+      </provider>
475
+    </entry>
476
+    <entry file="file://$PROJECT_DIR$/src/main/java/Transaction.java">
477
+      <provider selected="true" editor-type-id="text-editor">
478
+        <state relative-caret-position="225">
479
+          <caret line="16" column="5" selection-start-line="16" selection-start-column="5" selection-end-line="16" selection-end-column="5" />
480
+        </state>
481
+      </provider>
482
+    </entry>
483
+    <entry file="file://$PROJECT_DIR$/src/main/java/GenericAccount.java">
484
+      <provider selected="true" editor-type-id="text-editor">
485
+        <state relative-caret-position="767">
486
+          <caret line="53" column="5" lean-forward="true" selection-start-line="53" selection-start-column="5" selection-end-line="53" selection-end-column="5" />
487
+          <folding>
488
+            <element signature="imports" expanded="true" />
489
+            <element signature="e#613#614#0" expanded="true" />
490
+            <element signature="e#641#642#0" expanded="true" />
491
+            <element signature="e#682#683#0" expanded="true" />
492
+            <element signature="e#716#717#0" expanded="true" />
493
+            <element signature="e#750#751#0" expanded="true" />
494
+            <element signature="e#780#781#0" expanded="true" />
495
+            <element signature="e#826#827#0" expanded="true" />
496
+            <element signature="e#864#865#0" expanded="true" />
497
+            <element signature="e#905#906#0" expanded="true" />
498
+            <element signature="e#941#942#0" expanded="true" />
499
+            <element signature="e#1000#1001#0" expanded="true" />
500
+            <element signature="e#1050#1051#0" expanded="true" />
501
+            <element signature="e#1081#1082#0" expanded="true" />
502
+            <element signature="e#1108#1109#0" expanded="true" />
503
+            <element signature="e#1148#1149#0" expanded="true" />
504
+            <element signature="e#1180#1181#0" expanded="true" />
505
+          </folding>
506
+        </state>
507
+      </provider>
508
+    </entry>
509
+    <entry file="file://$PROJECT_DIR$/src/main/java/Payee.java">
510
+      <provider selected="true" editor-type-id="text-editor">
511
+        <state relative-caret-position="90">
512
+          <caret line="6" column="76" selection-start-line="6" selection-start-column="76" selection-end-line="6" selection-end-column="76" />
513
+        </state>
514
+      </provider>
515
+    </entry>
516
+    <entry file="file://$PROJECT_DIR$/src/test/java/TestGenericAccount.java">
517
+      <provider selected="true" editor-type-id="text-editor">
518
+        <state relative-caret-position="169">
519
+          <caret line="18" column="59" selection-start-line="18" selection-start-column="59" selection-end-line="18" selection-end-column="59" />
520
+          <folding>
521
+            <element signature="imports" expanded="true" />
522
+          </folding>
523
+        </state>
524
+      </provider>
525
+    </entry>
526
+    <entry file="file://$PROJECT_DIR$/src/main/java/Checkbook.java">
527
+      <provider selected="true" editor-type-id="text-editor">
528
+        <state relative-caret-position="231">
529
+          <caret line="100" column="13" lean-forward="true" selection-start-line="100" selection-start-column="13" selection-end-line="100" selection-end-column="13" />
530
+          <folding>
531
+            <element signature="imports" expanded="true" />
532
+            <element signature="e#280#281#0" expanded="true" />
533
+            <element signature="e#330#331#0" expanded="true" />
534
+            <element signature="e#501#502#0" expanded="true" />
535
+            <element signature="e#534#535#0" expanded="true" />
536
+            <element signature="e#662#663#0" expanded="true" />
537
+            <element signature="e#693#694#0" expanded="true" />
538
+            <element signature="e#759#760#0" expanded="true" />
539
+            <element signature="e#785#786#0" expanded="true" />
540
+            <element signature="e#3845#3846#0" expanded="true" />
541
+            <element signature="e#3869#3870#0" expanded="true" />
542
+          </folding>
543
+        </state>
544
+      </provider>
545
+    </entry>
546
+    <entry file="file://$PROJECT_DIR$/src/test/java/CheckbookTest.java">
547
+      <provider selected="true" editor-type-id="text-editor">
548
+        <state relative-caret-position="113">
549
+          <caret line="173" column="82" selection-start-line="173" selection-start-column="82" selection-end-line="173" selection-end-column="82" />
550
+          <folding>
551
+            <element signature="imports" expanded="true" />
552
+            <element signature="e#779#780#0" expanded="true" />
553
+            <element signature="e#803#804#0" expanded="true" />
554
+            <element signature="e#1028#1029#0" expanded="true" />
555
+            <element signature="e#1063#1064#0" expanded="true" />
556
+            <element signature="e#1258#1259#0" expanded="true" />
557
+            <element signature="e#1294#1295#0" expanded="true" />
558
+          </folding>
559
+        </state>
560
+      </provider>
561
+    </entry>
562
+  </component>
563
+  <component name="masterDetails">
564
+    <states>
565
+      <state key="ProjectJDKs.UI">
566
+        <settings>
567
+          <last-edited>1.8</last-edited>
568
+          <splitter-proportions>
569
+            <option name="proportions">
570
+              <list>
571
+                <option value="0.2" />
572
+              </list>
573
+            </option>
574
+          </splitter-proportions>
575
+        </settings>
576
+      </state>
577
+    </states>
578
+  </component>
579
+</project>

+ 3
- 3
Checkbook/Checkbook.iml Dosyayı Görüntüle

@@ -5,12 +5,12 @@
5 5
     <output-test url="file://$MODULE_DIR$/target/test-classes" />
6 6
     <content url="file://$MODULE_DIR$">
7 7
       <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8
-      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
9 8
       <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
10 9
       <excludeFolder url="file://$MODULE_DIR$/target" />
11 10
     </content>
12
-    <orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
11
+    <orderEntry type="inheritedJdk" />
13 12
     <orderEntry type="sourceFolder" forTests="false" />
14
-    <orderEntry type="library" name="Maven: junit:junit:4.0" level="project" />
13
+    <orderEntry type="library" name="Maven: junit:junit:4.12" level="project" />
14
+    <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
15 15
   </component>
16 16
 </module>

+ 1
- 1
Checkbook/pom.xml Dosyayı Görüntüle

@@ -23,7 +23,7 @@
23 23
         <dependency>
24 24
             <groupId>junit</groupId>
25 25
             <artifactId>junit</artifactId>
26
-            <version>4.0</version>
26
+            <version>4.12</version>
27 27
         </dependency>
28 28
     </dependencies>
29 29
 

+ 143
- 2
Checkbook/src/main/java/Checkbook.java Dosyayı Görüntüle

@@ -1,5 +1,146 @@
1
-public class Checkbook {
1
+import java.time.LocalDate;
2
+import java.util.ArrayList;
3
+import java.util.Iterator;
4
+import java.util.List;
2 5
 
3
-    //blind us with your Java eloquence....
6
+public class Checkbook<T extends Transaction>{
7
+    private ArrayList<Transaction> checkBook;
8
+    private double cashAmount;
9
+    private Payee owner;
4 10
 
11
+    public Checkbook() {
12
+        this.checkBook = new ArrayList<>();
13
+    }
14
+
15
+    public Checkbook(double cashAmount) {
16
+        this.cashAmount = cashAmount;
17
+        this.checkBook = new ArrayList<>();
18
+    }
19
+
20
+    public Checkbook(Payee owner, double cashAmount) {
21
+        this.cashAmount = cashAmount;
22
+        this.owner = owner;
23
+        this.checkBook = new ArrayList<>();
24
+    }
25
+
26
+    public int size(){
27
+        return checkBook.size();
28
+    }
29
+
30
+    public boolean isEmpty(){
31
+        return checkBook.isEmpty();
32
+    }
33
+
34
+    public boolean contains(Transaction element){
35
+        return checkBook.contains(element);
36
+    }
37
+
38
+    public boolean add(Transaction element){
39
+        checkBook.add(element);
40
+        return true;
41
+    }
42
+
43
+    public boolean remove(Transaction element){
44
+        checkBook.remove(element);
45
+        return true;
46
+    }
47
+
48
+    public Iterator iterator(){
49
+        Iterator<Transaction> iterator = this.checkBook.listIterator();
50
+        return iterator;
51
+    }
52
+
53
+    public Transaction[] toArray(){
54
+        Transaction[] array = new Transaction[this.checkBook.size()];
55
+
56
+        for (int i = 0; i < checkBook.size(); i++) {
57
+            array[i] = checkBook.get(i);
58
+        }
59
+        return array;
60
+    }
61
+
62
+    public Transaction[] toArray(List<Transaction> transactions){
63
+        Transaction[] array = new Transaction[checkBook.size()];
64
+        int index = 0;
65
+
66
+        for(Transaction t:transactions){
67
+            array[index] = t;
68
+            index++;
69
+        }
70
+        return array;
71
+    }
72
+
73
+    // sum of all Transactions (both Debits and Credits)
74
+    public double checkbookValue(){
75
+        double value = this.cashAmount;
76
+        for(Transaction t:checkBook){
77
+            if(t.getType().equals(TransactionType.CREDIT)) {
78
+                value += t.getAmount();
79
+            }else if(t.getType().equals(TransactionType.DEBIT)) {
80
+                value -= t.getAmount();
81
+            }
82
+        }
83
+        return value;
84
+    }
85
+
86
+    public Transaction[] getTransactionsForDate(LocalDate aDate){
87
+        ArrayList<Transaction> result = new ArrayList<>();
88
+        for(Transaction t:checkBook){
89
+            if(t.getDate().equals(aDate)){
90
+                result.add(t);
91
+            }
92
+        }
93
+        return toArray(result);
94
+    }
95
+
96
+    public Transaction[] getAllTransactionsForPayee(Payee payee){
97
+        ArrayList<Transaction> result = new ArrayList<>();
98
+        for(Transaction t:checkBook){
99
+            if(t.getPayee().equals(payee)){
100
+                result.add(t);
101
+            }
102
+        }
103
+        return toArray(result);
104
+    }
105
+
106
+    public Transaction[] getAllDebitTransactions(){
107
+        ArrayList<Transaction> result = new ArrayList<>();
108
+        for(Transaction t:checkBook){
109
+            if(t.getType().equals(TransactionType.DEBIT)){
110
+                result.add(t);
111
+            }
112
+        }
113
+        return toArray(result);
114
+    }
115
+
116
+    public Transaction[] getAllCreditTransactions(){
117
+        ArrayList<Transaction> result = new ArrayList<>();
118
+        for(Transaction t:checkBook){
119
+            if(t.getType().equals(TransactionType.CREDIT)){
120
+                result.add(t);
121
+            }
122
+        }
123
+        return toArray(result);
124
+    }
125
+
126
+    public boolean containsAll(List<Transaction> transactions){
127
+        boolean result = checkBook.containsAll(transactions);
128
+        return result;
129
+    }
130
+
131
+    public boolean addAll(List<Transaction> transactions){
132
+
133
+        boolean result = checkBook.addAll(transactions);
134
+
135
+        return result;
136
+    }
137
+
138
+    public boolean removeAll(List<Transaction> transactions){
139
+        boolean result = checkBook.removeAll(transactions);
140
+        return result;
141
+    }
142
+
143
+    public void clear(){
144
+        checkBook = new ArrayList<>();
145
+    }
5 146
 }

+ 53
- 1
Checkbook/src/main/java/GenericAccount.java Dosyayı Görüntüle

@@ -1,3 +1,55 @@
1
+import java.util.ArrayList;
2
+import java.util.List;
1 3
 
2
-public class GenericAccount {
4
+public class GenericAccount<T extends AccountBook> {
5
+
6
+    private Payee owner;
7
+    private double balance;
8
+    List<T> accountRecord;
9
+    TransactionType type;
10
+
11
+    public GenericAccount(double balance, TransactionType type) {
12
+        this.balance = balance;
13
+        this.type = type;
14
+        this.accountRecord = new ArrayList<>();
15
+    }
16
+
17
+    public GenericAccount(Payee owner, double balance, TransactionType type) {
18
+        this.owner = owner;
19
+        this.balance = balance;
20
+        this.type = type;
21
+        this.accountRecord = new ArrayList<>();
22
+    }
23
+
24
+    public Payee getOwner() {
25
+        return owner;
26
+    }
27
+
28
+    public void setOwner(Payee owner) {
29
+        this.owner = owner;
30
+    }
31
+
32
+    public double getBalance() {
33
+        return balance;
34
+    }
35
+
36
+    public void setBalance(double balance) {
37
+        this.balance = balance;
38
+    }
39
+
40
+    public List<T> getAccountRecord() {
41
+        return accountRecord;
42
+    }
43
+
44
+    public void setAccountRecord(List<T> accountRecord) {
45
+        this.accountRecord = accountRecord;
46
+    }
47
+
48
+    public Object getType() {
49
+        return type;
50
+    }
51
+
52
+    public void setType(TransactionType type) {
53
+        this.type = type;
54
+    }
3 55
 }

+ 6
- 0
Checkbook/src/main/java/Payee.java Dosyayı Görüntüle

@@ -4,6 +4,12 @@ public class Payee {
4 4
     private String givenName;
5 5
     private String emailAddress;
6 6
 
7
+    public Payee(String familyName, String givenName, String emailAddress) {
8
+        this.familyName = familyName;
9
+        this.givenName = givenName;
10
+        this.emailAddress = emailAddress;
11
+    }
12
+
7 13
     public String getFamilyName() {
8 14
         return familyName;
9 15
     }

+ 1
- 1
Checkbook/src/main/java/Transaction.java Dosyayı Görüntüle

@@ -1,7 +1,7 @@
1 1
 import java.time.LocalDate;
2 2
 import java.util.concurrent.atomic.AtomicReference;
3 3
 
4
-public class Transaction {
4
+public class Transaction implements AccountBook{
5 5
     private final AtomicReference<Integer> id = new AtomicReference<Integer>();
6 6
     private final AtomicReference<LocalDate> date = new AtomicReference<LocalDate>();
7 7
     private String memo;

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

@@ -1,12 +1,346 @@
1
-import static org.junit.Assert.*;
1
+import org.junit.Assert;
2
+import org.junit.Before;
3
+import org.junit.Test;
4
+
5
+import java.time.LocalDate;
6
+import java.util.ArrayList;
7
+import java.util.Iterator;
8
+import java.util.List;
2 9
 
3 10
 public class CheckbookTest {
11
+    Checkbook checkbook;
12
+    Transaction waterBill;
13
+    Transaction mortgage;
14
+    Transaction dateNight;
15
+    Payee payee1;
16
+    Payee payee2;
17
+    Payee payee3;
18
+
4 19
 
5
-    @org.junit.Before
20
+    @Before
6 21
     public void setUp() throws Exception {
22
+        checkbook = new Checkbook(payee1,2000);
23
+        waterBill = new Transaction("Water Bill", payee1, TransactionType.CREDIT,100.00);
24
+        mortgage = new Transaction("Mortgage", payee2, TransactionType.CREDIT, 1000.00);
25
+        dateNight = new Transaction("Date Night", payee3, TransactionType.DEBIT,150.00);
26
+        payee1 = new Payee("Payea", "One", "onep@email.com");
27
+        payee2 = new Payee("Payee","Two","twop@email.com");
28
+        payee3 = new Payee("Payei", "Three", "threep@email.com");
7 29
     }
8 30
 
9 31
     @org.junit.After
10 32
     public void tearDown() throws Exception {
11 33
     }
34
+
35
+    @Test
36
+    public void testSize1(){
37
+        checkbook.add(waterBill);
38
+
39
+        int expected = 1;
40
+        int actual = checkbook.size();
41
+
42
+        Assert.assertEquals(expected,actual);
43
+    }
44
+
45
+    @Test
46
+    public void testSize2(){
47
+        Assert.assertEquals(0,checkbook.size());
48
+    }
49
+
50
+    @Test
51
+    public void testSize3(){
52
+        checkbook.add(waterBill);
53
+        checkbook.add(mortgage);
54
+        Assert.assertEquals(2,checkbook.size());
55
+    }
56
+
57
+    @Test
58
+    public void testIsEmpty1(){
59
+        Assert.assertTrue(checkbook.isEmpty());
60
+    }
61
+
62
+    @Test
63
+    public void testIsEmpty2(){
64
+        checkbook.add(waterBill);
65
+        Assert.assertFalse(checkbook.isEmpty());
66
+    }
67
+
68
+    @Test
69
+    public void testContains1(){
70
+        Assert.assertFalse(checkbook.contains(waterBill));
71
+    }
72
+
73
+    @Test
74
+    public void testContains2(){
75
+        checkbook.add(mortgage);
76
+        Assert.assertTrue(checkbook.contains(mortgage));
77
+    }
78
+
79
+    @Test
80
+    public void testAdd1(){
81
+        checkbook.add(mortgage);
82
+        checkbook.add(waterBill);
83
+        Assert.assertFalse(checkbook.isEmpty());
84
+    }
85
+
86
+    @Test
87
+    public void testAdd2(){
88
+        checkbook.add(mortgage);
89
+
90
+        Assert.assertEquals(1,checkbook.size());
91
+    }
92
+
93
+    @Test
94
+    public void testRemove1(){
95
+        checkbook.add(mortgage);
96
+        checkbook.remove(mortgage);
97
+
98
+        Assert.assertTrue(checkbook.isEmpty());
99
+    }
100
+
101
+    @Test
102
+    public void testRemove2(){
103
+        checkbook.add(dateNight);
104
+        checkbook.add(mortgage);
105
+        checkbook.remove(mortgage);
106
+
107
+        Assert.assertEquals(1,checkbook.size());
108
+    }
109
+
110
+    @Test
111
+    public void testIterator1(){
112
+        checkbook.add(waterBill);
113
+        checkbook.add(dateNight);
114
+        Iterator<Transaction> it = checkbook.iterator();
115
+
116
+        Assert.assertNotNull(it.next());
117
+    }
118
+
119
+    @Test
120
+    public void testIterator2(){
121
+        checkbook.add(waterBill);
122
+        Iterator<Transaction> it = checkbook.iterator();
123
+
124
+        Assert.assertTrue(it.hasNext());
125
+    }
126
+
127
+    @Test
128
+    public void testToArray1(){
129
+        checkbook.add(waterBill);
130
+        checkbook.add(dateNight);
131
+        checkbook.add(mortgage);
132
+
133
+        Transaction[] expected = {waterBill,dateNight,mortgage};
134
+        Transaction[] actual = checkbook.toArray();
135
+
136
+        Assert.assertEquals(expected,actual);
137
+    }
138
+
139
+    @Test
140
+    public void testToArray2(){
141
+        checkbook.add(mortgage);
142
+        checkbook.add(dateNight);
143
+
144
+        Transaction[] expected = {mortgage,dateNight};
145
+        Transaction[] actual = checkbook.toArray();
146
+
147
+        Assert.assertEquals(expected,actual);
148
+    }
149
+
150
+    @Test
151
+    public void testCheckbookValue1_afterCredit(){
152
+        checkbook.add(mortgage);
153
+
154
+        double expected = 1000.00;
155
+        double actual = checkbook.checkbookValue();
156
+
157
+        Assert.assertEquals(expected,actual,0.01);
158
+    }
159
+
160
+    @Test
161
+    public void testCheckbookValue1_afterDebit(){
162
+        checkbook.add(dateNight);
163
+
164
+        double expected = 1850.00;
165
+        double actual = checkbook.checkbookValue();
166
+
167
+        Assert.assertEquals(expected,actual,0.01);
168
+    }
169
+
170
+    @Test
171
+    public void testgetTransactionsForDate1(){
172
+        checkbook.add(mortgage);
173
+        Transaction[] expected = {mortgage};
174
+        Transaction[] actual = checkbook.getTransactionsForDate(LocalDate.now());
175
+
176
+        Assert.assertEquals(expected,actual);
177
+    }
178
+
179
+    @Test
180
+    public void testgetTransactionsForDate2(){
181
+        checkbook.add(mortgage);
182
+        checkbook.add(dateNight);
183
+        checkbook.add(waterBill);
184
+        Transaction[] expected = {mortgage,dateNight,waterBill};
185
+        Transaction[] actual = checkbook.getTransactionsForDate(LocalDate.now());
186
+
187
+        Assert.assertEquals(expected,actual);
188
+    }
189
+
190
+    @Test
191
+    public void testGetAllTransactionsForPayee1(){
192
+        checkbook.add(mortgage);
193
+        checkbook.add(dateNight);
194
+        checkbook.add(waterBill);
195
+
196
+        Transaction[] expected = {mortgage};
197
+        Transaction[] actual = checkbook.getAllTransactionsForPayee(payee1);
198
+
199
+        Assert.assertEquals(expected,actual);
200
+    }
201
+
202
+    @Test
203
+    public void testGetAllTransactionsForPayee3(){
204
+        checkbook.add(mortgage);
205
+
206
+        Assert.assertEquals(1,checkbook.getAllTransactionsForPayee(payee2).length);
207
+    }
208
+
209
+    @Test
210
+    public void testGetAllTransactionsForPayee2(){
211
+        checkbook.add(mortgage);
212
+        checkbook.add(dateNight);
213
+
214
+        Transaction[] expected = {mortgage};
215
+        Transaction[] actual = checkbook.getAllTransactionsForPayee(payee2);
216
+
217
+        Assert.assertEquals(expected,actual);
218
+    }
219
+
220
+    @Test
221
+    public void testGetAllDebitTransactions1(){
222
+        checkbook.add(mortgage);
223
+        checkbook.add(dateNight);
224
+        checkbook.add(waterBill);
225
+
226
+        Transaction[] expected = {dateNight};
227
+        Transaction[] actual = checkbook.getAllDebitTransactions();
228
+
229
+        Assert.assertEquals(expected,actual);
230
+    }
231
+
232
+    @Test
233
+    public void testGetAllDebitTransactions2(){
234
+        checkbook.add(mortgage);
235
+        checkbook.add(dateNight);
236
+        checkbook.add(waterBill);
237
+
238
+        Transaction[] expected = {mortgage,dateNight};
239
+        Transaction[] actual = checkbook.getAllCreditTransactions();
240
+
241
+        Assert.assertEquals(expected,actual);
242
+    }
243
+
244
+    @Test
245
+    public void testGetAllDebitTransactions3(){
246
+        checkbook.add(mortgage);
247
+        checkbook.add(dateNight);
248
+        checkbook.add(waterBill);
249
+
250
+        int expected = 2;
251
+        int actual = checkbook.getAllCreditTransactions().length;
252
+
253
+        Assert.assertEquals(expected,actual);
254
+    }
255
+
256
+    @Test
257
+    public void testContainsAll1(){
258
+        List list = new ArrayList();
259
+        list.add(mortgage);
260
+        list.add(dateNight);
261
+
262
+        checkbook.addAll(list);
263
+        Assert.assertTrue(checkbook.containsAll(list));
264
+    }
265
+
266
+    @Test
267
+    public void testContainsAll2(){
268
+        List list = new ArrayList();
269
+        list.add(mortgage);
270
+        list.add(dateNight);
271
+
272
+        checkbook.add(waterBill);
273
+
274
+        Assert.assertFalse(checkbook.containsAll(list));
275
+    }
276
+
277
+    @Test
278
+    public void testAddAll1(){
279
+        List list = new ArrayList();
280
+        list.add(mortgage);
281
+        list.add(dateNight);
282
+
283
+        checkbook.addAll(list);
284
+
285
+        Assert.assertEquals(2,checkbook.size());
286
+    }
287
+
288
+    @Test
289
+    public void testAddAll2(){
290
+        List list = new ArrayList();
291
+        list.add(mortgage);
292
+        list.add(dateNight);
293
+        list.add(mortgage);
294
+        list.add(waterBill);
295
+
296
+        checkbook.addAll(list);
297
+
298
+        Assert.assertEquals(4,checkbook.size());
299
+    }
300
+
301
+    @Test
302
+    public void testRemoveAll1(){
303
+        List list = new ArrayList();
304
+        list.add(mortgage);
305
+        list.add(dateNight);
306
+        list.add(mortgage);
307
+
308
+        checkbook.addAll(list);
309
+        checkbook.removeAll(list);
310
+
311
+        Assert.assertEquals(0,checkbook.size());
312
+    }
313
+
314
+    @Test
315
+    public void testRemoveAll2(){
316
+        List list = new ArrayList();
317
+        list.add(mortgage);
318
+        list.add(dateNight);
319
+        list.add(mortgage);
320
+
321
+        checkbook.addAll(list);
322
+        checkbook.removeAll(list);
323
+
324
+        Assert.assertTrue(checkbook.isEmpty());
325
+    }
326
+
327
+    @Test
328
+    public void testClear1(){
329
+        checkbook.add(mortgage);
330
+        checkbook.add(dateNight);
331
+
332
+        checkbook.clear();
333
+
334
+        Assert.assertTrue(checkbook.isEmpty());
335
+    }
336
+
337
+    @Test
338
+    public void testClear2(){
339
+        checkbook.add(mortgage);
340
+        checkbook.add(dateNight);
341
+
342
+        checkbook.clear();
343
+
344
+        Assert.assertFalse(checkbook.contains(mortgage));
345
+    }
12 346
 }

+ 91
- 0
Checkbook/src/test/java/TestGenericAccount.java Dosyayı Görüntüle

@@ -0,0 +1,91 @@
1
+import org.junit.Assert;
2
+import org.junit.Before;
3
+import org.junit.Test;
4
+
5
+import java.util.ArrayList;
6
+import java.util.List;
7
+
8
+public class TestGenericAccount {
9
+    GenericAccount generic;
10
+    Payee payee1;
11
+    Payee payee2;
12
+    Transaction transaction1;
13
+    Transaction transaction2;
14
+    Transaction transaction3;
15
+
16
+    @Before
17
+    public void SetUp(){
18
+        payee1 = new Payee("Payea", "One", "onep@email.com");
19
+        payee2 = new Payee("Payee","Two","twop@email.com");
20
+        generic = new GenericAccount(payee1,2000.00,TransactionType.CREDIT);
21
+        transaction1 = new Transaction("Movies", payee1, TransactionType.CREDIT,30.00);
22
+        transaction2 = new Transaction("Eat Out", payee2, TransactionType.DEBIT, 50.00);
23
+        transaction3 = new Transaction("Groceries", payee2, TransactionType.CREDIT, 75.50);
24
+    }
25
+
26
+    @Test
27
+    public void testConstructor(){
28
+        Assert.assertEquals(2000.00,generic.getBalance(),0.01);
29
+        Assert.assertEquals(payee1, generic.getOwner());
30
+        Assert.assertEquals(TransactionType.CREDIT,generic.getType());
31
+    }
32
+
33
+    @Test
34
+    public void testSetGetOwner1(){
35
+        generic.setOwner(payee1);
36
+        Assert.assertEquals(payee1, generic.getOwner());
37
+    }
38
+
39
+    @Test
40
+    public void testSetGetOwner2(){
41
+        generic.setOwner(payee2);
42
+        Assert.assertEquals(payee2,generic.getOwner());
43
+    }
44
+
45
+    @Test
46
+    public void testSetGetBalance1(){
47
+        generic.setBalance(1000.00);
48
+
49
+        Assert.assertEquals(1000.00,generic.getBalance(),0.01);
50
+    }
51
+
52
+    @Test
53
+    public void testSetGetBalance2(){
54
+        generic.setBalance(12345.67);
55
+        Assert.assertEquals(12345.67,generic.getBalance(),0.01);
56
+    }
57
+
58
+    @Test
59
+    public void testSetAccountRecord(){
60
+        List<Transaction> list = new ArrayList<>();
61
+        list.add(transaction1);
62
+        list.add(transaction2);
63
+
64
+        generic.setAccountRecord(list);
65
+        Assert.assertEquals(transaction1,generic.getAccountRecord().get(0));
66
+    }
67
+
68
+    @Test
69
+    public void testSetAccountRecord2(){
70
+        List<Transaction> list = new ArrayList<>();
71
+        list.add(transaction1);
72
+        list.add(transaction2);
73
+
74
+        generic.setAccountRecord(list);
75
+        Assert.assertEquals(2,generic.getAccountRecord().size());
76
+    }
77
+
78
+    @Test
79
+    public void testSetGetType1(){
80
+        generic.setType(TransactionType.CREDIT);
81
+
82
+        Assert.assertEquals(TransactionType.CREDIT,generic.getType());
83
+    }
84
+
85
+    @Test
86
+    public void testSetGetType2(){
87
+        generic.setType(TransactionType.DEBIT);
88
+
89
+        Assert.assertEquals(TransactionType.DEBIT,generic.getType());
90
+    }
91
+}