Connor Dunnigan 6 yıl önce
ebeveyn
işleme
09402b7dac

+ 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>

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

@@ -0,0 +1,4 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="Encoding" addBOMForNewFiles="with NO BOM" />
4
+</project>

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

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

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

@@ -0,0 +1,611 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="7fd565bb-b6b0-477d-a84c-5bf48bedf3f5" 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_0.xml" afterDir="false" />
7
+      <change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
8
+      <change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
9
+      <change afterPath="$PROJECT_DIR$/src/test/java/GenericAccountTest.java" afterDir="false" />
10
+      <change beforePath="$PROJECT_DIR$/Checkbook.iml" beforeDir="false" afterPath="$PROJECT_DIR$/Checkbook.iml" afterDir="false" />
11
+      <change beforePath="$PROJECT_DIR$/src/main/java/AccountBook.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/AccountBook.java" afterDir="false" />
12
+      <change beforePath="$PROJECT_DIR$/src/main/java/Checkbook.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Checkbook.java" afterDir="false" />
13
+      <change beforePath="$PROJECT_DIR$/src/main/java/GenericAccount.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/GenericAccount.java" afterDir="false" />
14
+      <change beforePath="$PROJECT_DIR$/src/main/java/Payee.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Payee.java" afterDir="false" />
15
+      <change beforePath="$PROJECT_DIR$/src/main/java/Transaction.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Transaction.java" afterDir="false" />
16
+      <change beforePath="$PROJECT_DIR$/src/test/java/CheckbookTest.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/test/java/CheckbookTest.java" afterDir="false" />
17
+    </list>
18
+    <ignored path="$PROJECT_DIR$/target/" />
19
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
20
+    <option name="SHOW_DIALOG" value="false" />
21
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
22
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
23
+    <option name="LAST_RESOLUTION" value="IGNORE" />
24
+  </component>
25
+  <component name="FileEditorManager">
26
+    <splitter split-orientation="horizontal" split-proportion="0.50905216">
27
+      <split-first>
28
+        <leaf>
29
+          <file pinned="false" current-in-tab="false">
30
+            <entry file="file://$PROJECT_DIR$/src/main/java/AccountBook.java">
31
+              <provider selected="true" editor-type-id="text-editor">
32
+                <state relative-caret-position="230">
33
+                  <caret line="10" column="5" selection-start-line="10" selection-start-column="5" selection-end-line="10" selection-end-column="5" />
34
+                </state>
35
+              </provider>
36
+            </entry>
37
+          </file>
38
+          <file pinned="false" current-in-tab="false">
39
+            <entry file="file://$PROJECT_DIR$/src/main/java/Checkbook.java">
40
+              <provider selected="true" editor-type-id="text-editor">
41
+                <state relative-caret-position="828">
42
+                  <caret line="36" column="4" selection-start-line="36" selection-start-column="4" selection-end-line="36" selection-end-column="4" />
43
+                  <folding>
44
+                    <element signature="imports" expanded="true" />
45
+                    <element signature="e#547#548#0" expanded="true" />
46
+                    <element signature="e#599#600#0" expanded="true" />
47
+                    <element signature="e#766#767#0" expanded="true" />
48
+                    <element signature="e#810#811#0" expanded="true" />
49
+                    <element signature="e#1014#1015#0" expanded="true" />
50
+                    <element signature="e#1053#1054#0" expanded="true" />
51
+                    <element signature="e#1316#1317#0" expanded="true" />
52
+                    <element signature="e#1355#1356#0" expanded="true" />
53
+                    <element signature="e#1306#1307#0" expanded="true" />
54
+                    <element signature="e#1346#1347#0" expanded="true" />
55
+                    <element signature="e#1383#1384#0" expanded="true" />
56
+                    <element signature="e#1421#1422#0" expanded="true" />
57
+                    <element signature="e#1597#1598#0" expanded="true" />
58
+                    <element signature="e#1624#1625#0" expanded="true" />
59
+                  </folding>
60
+                </state>
61
+              </provider>
62
+            </entry>
63
+          </file>
64
+          <file pinned="false" current-in-tab="true">
65
+            <entry file="file://$PROJECT_DIR$/src/main/java/GenericAccount.java">
66
+              <provider selected="true" editor-type-id="text-editor">
67
+                <state relative-caret-position="713">
68
+                  <caret line="31" column="59" selection-start-line="31" selection-start-column="59" selection-end-line="31" selection-end-column="59" />
69
+                  <folding>
70
+                    <element signature="imports" expanded="true" />
71
+                    <element signature="e#661#662#0" expanded="true" />
72
+                    <element signature="e#710#711#0" expanded="true" />
73
+                    <element signature="e#770#771#0" expanded="true" />
74
+                    <element signature="e#812#813#0" expanded="true" />
75
+                    <element signature="e#1118#1119#0" expanded="true" />
76
+                    <element signature="e#1155#1156#0" expanded="true" />
77
+                    <element signature="e#1354#1355#0" expanded="true" />
78
+                    <element signature="e#1394#1395#0" expanded="true" />
79
+                    <element signature="e#1439#1440#0" expanded="true" />
80
+                    <element signature="e#1477#1478#0" expanded="true" />
81
+                    <element signature="e#1668#1669#0" expanded="true" />
82
+                    <element signature="e#1723#1724#0" expanded="true" />
83
+                  </folding>
84
+                </state>
85
+              </provider>
86
+            </entry>
87
+          </file>
88
+          <file pinned="false" current-in-tab="false">
89
+            <entry file="file://$PROJECT_DIR$/src/main/java/Payee.java">
90
+              <provider selected="true" editor-type-id="text-editor">
91
+                <state relative-caret-position="138">
92
+                  <caret line="6" column="21" selection-start-line="6" selection-start-column="21" selection-end-line="6" selection-end-column="21" />
93
+                </state>
94
+              </provider>
95
+            </entry>
96
+          </file>
97
+          <file pinned="false" current-in-tab="false">
98
+            <entry file="file://$PROJECT_DIR$/src/main/java/Transaction.java">
99
+              <provider selected="true" editor-type-id="text-editor">
100
+                <state relative-caret-position="131">
101
+                  <caret line="9" column="24" lean-forward="true" selection-start-line="9" selection-start-column="24" selection-end-line="9" selection-end-column="24" />
102
+                  <folding>
103
+                    <element signature="e#1136#1137#0" expanded="true" />
104
+                    <element signature="e#1221#1222#0" expanded="true" />
105
+                  </folding>
106
+                </state>
107
+              </provider>
108
+            </entry>
109
+          </file>
110
+          <file pinned="false" current-in-tab="false">
111
+            <entry file="file://$PROJECT_DIR$/src/main/java/TransactionType.java">
112
+              <provider selected="true" editor-type-id="text-editor">
113
+                <state relative-caret-position="23">
114
+                  <caret line="1" column="12" selection-start-line="1" selection-start-column="12" selection-end-line="1" selection-end-column="12" />
115
+                </state>
116
+              </provider>
117
+            </entry>
118
+          </file>
119
+        </leaf>
120
+      </split-first>
121
+      <split-second>
122
+        <leaf>
123
+          <file pinned="false" current-in-tab="false">
124
+            <entry file="file://$PROJECT_DIR$/src/test/java/CheckbookTest.java">
125
+              <provider selected="true" editor-type-id="text-editor">
126
+                <state relative-caret-position="575">
127
+                  <caret line="25" column="4" selection-start-line="25" selection-start-column="4" selection-end-line="25" selection-end-column="4" />
128
+                  <folding>
129
+                    <element signature="imports" expanded="true" />
130
+                    <element signature="e#2986#2987#0" expanded="true" />
131
+                    <element signature="e#4256#4257#0" expanded="true" />
132
+                  </folding>
133
+                </state>
134
+              </provider>
135
+            </entry>
136
+          </file>
137
+          <file pinned="false" current-in-tab="true">
138
+            <entry file="file://$PROJECT_DIR$/src/test/java/GenericAccountTest.java">
139
+              <provider selected="true" editor-type-id="text-editor">
140
+                <state relative-caret-position="700">
141
+                  <caret line="35" column="59" selection-start-line="35" selection-start-column="59" selection-end-line="35" selection-end-column="59" />
142
+                  <folding>
143
+                    <element signature="imports" expanded="true" />
144
+                    <element signature="e#1323#1324#0" expanded="true" />
145
+                    <element signature="e#1389#1390#0" expanded="true" />
146
+                    <element signature="e#3288#3289#0" expanded="true" />
147
+                  </folding>
148
+                </state>
149
+              </provider>
150
+            </entry>
151
+          </file>
152
+        </leaf>
153
+      </split-second>
154
+    </splitter>
155
+  </component>
156
+  <component name="FileTemplateManagerImpl">
157
+    <option name="RECENT_TEMPLATES">
158
+      <list>
159
+        <option value="Class" />
160
+      </list>
161
+    </option>
162
+  </component>
163
+  <component name="FindInProjectRecents">
164
+    <findStrings>
165
+      <find>chBook</find>
166
+    </findStrings>
167
+    <replaceStrings>
168
+      <replace>book</replace>
169
+    </replaceStrings>
170
+  </component>
171
+  <component name="Git.Settings">
172
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
173
+  </component>
174
+  <component name="IdeDocumentHistory">
175
+    <option name="CHANGED_PATHS">
176
+      <list>
177
+        <option value="$PROJECT_DIR$/src/main/java/AccountBook.java" />
178
+        <option value="$PROJECT_DIR$/src/main/java/Payee.java" />
179
+        <option value="$PROJECT_DIR$/src/main/java/Transaction.java" />
180
+        <option value="$PROJECT_DIR$/src/main/java/Checkbook.java" />
181
+        <option value="$PROJECT_DIR$/src/test/java/CheckbookTest.java" />
182
+        <option value="$PROJECT_DIR$/src/main/java/GenericAccount.java" />
183
+        <option value="$PROJECT_DIR$/src/test/java/GenericAccountTest.java" />
184
+      </list>
185
+    </option>
186
+  </component>
187
+  <component name="ProjectFrameBounds" fullScreen="true">
188
+    <option name="x" value="-345" />
189
+    <option name="y" value="-1057" />
190
+    <option name="width" value="1920" />
191
+    <option name="height" value="1057" />
192
+  </component>
193
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
194
+  <component name="ProjectView">
195
+    <navigator proportions="" version="1">
196
+      <foldersAlwaysOnTop value="true" />
197
+    </navigator>
198
+    <panes>
199
+      <pane id="PackagesPane" />
200
+      <pane id="ProjectPane">
201
+        <subPane>
202
+          <expand>
203
+            <path>
204
+              <item name="Checkbook" type="b2602c69:ProjectViewProjectNode" />
205
+              <item name="Checkbook" type="462c0819:PsiDirectoryNode" />
206
+            </path>
207
+            <path>
208
+              <item name="Checkbook" type="b2602c69:ProjectViewProjectNode" />
209
+              <item name="Checkbook" type="462c0819:PsiDirectoryNode" />
210
+              <item name="src" type="462c0819:PsiDirectoryNode" />
211
+            </path>
212
+            <path>
213
+              <item name="Checkbook" type="b2602c69:ProjectViewProjectNode" />
214
+              <item name="Checkbook" type="462c0819:PsiDirectoryNode" />
215
+              <item name="src" type="462c0819:PsiDirectoryNode" />
216
+              <item name="main" type="462c0819:PsiDirectoryNode" />
217
+            </path>
218
+            <path>
219
+              <item name="Checkbook" type="b2602c69:ProjectViewProjectNode" />
220
+              <item name="Checkbook" type="462c0819:PsiDirectoryNode" />
221
+              <item name="src" type="462c0819:PsiDirectoryNode" />
222
+              <item name="main" type="462c0819:PsiDirectoryNode" />
223
+              <item name="java" type="462c0819:PsiDirectoryNode" />
224
+            </path>
225
+            <path>
226
+              <item name="Checkbook" type="b2602c69:ProjectViewProjectNode" />
227
+              <item name="Checkbook" type="462c0819:PsiDirectoryNode" />
228
+              <item name="src" type="462c0819:PsiDirectoryNode" />
229
+              <item name="test" type="462c0819:PsiDirectoryNode" />
230
+            </path>
231
+            <path>
232
+              <item name="Checkbook" type="b2602c69:ProjectViewProjectNode" />
233
+              <item name="Checkbook" type="462c0819:PsiDirectoryNode" />
234
+              <item name="src" type="462c0819:PsiDirectoryNode" />
235
+              <item name="test" type="462c0819:PsiDirectoryNode" />
236
+              <item name="java" type="462c0819:PsiDirectoryNode" />
237
+            </path>
238
+          </expand>
239
+          <select />
240
+        </subPane>
241
+      </pane>
242
+      <pane id="Scope" />
243
+    </panes>
244
+  </component>
245
+  <component name="PropertiesComponent">
246
+    <property name="WebServerToolWindowFactoryState" value="false" />
247
+    <property name="aspect.path.notification.shown" value="true" />
248
+    <property name="com.android.tools.idea.instantapp.provision.ProvisionBeforeRunTaskProvider.myTimeStamp" value="1544406091289" />
249
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/pom.xml" />
250
+    <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
251
+    <property name="nodejs_npm_path_reset_for_default_project" value="true" />
252
+    <property name="project.structure.last.edited" value="Project" />
253
+    <property name="project.structure.proportion" value="0.15" />
254
+    <property name="project.structure.side.proportion" value="0.0" />
255
+    <property name="settings.editor.selected.configurable" value="editor.preferences.gutterIcons" />
256
+  </component>
257
+  <component name="RunDashboard">
258
+    <option name="ruleStates">
259
+      <list>
260
+        <RuleState>
261
+          <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
262
+        </RuleState>
263
+        <RuleState>
264
+          <option name="name" value="StatusDashboardGroupingRule" />
265
+        </RuleState>
266
+      </list>
267
+    </option>
268
+  </component>
269
+  <component name="RunManager" selected="JUnit.All in Checkbook">
270
+    <configuration name="All in Checkbook" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
271
+      <module name="Checkbook" />
272
+      <option name="PACKAGE_NAME" value="" />
273
+      <option name="TEST_OBJECT" value="package" />
274
+      <method v="2">
275
+        <option name="Make" enabled="true" />
276
+      </method>
277
+    </configuration>
278
+    <configuration name="GenericAccountTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
279
+      <module name="Checkbook" />
280
+      <option name="PACKAGE_NAME" value="" />
281
+      <option name="MAIN_CLASS_NAME" value="GenericAccountTest" />
282
+      <method v="2">
283
+        <option name="Make" enabled="true" />
284
+      </method>
285
+    </configuration>
286
+    <configuration name="GenericAccountTest.test3_AccountBooks_CREDIT" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
287
+      <module name="Checkbook" />
288
+      <option name="PACKAGE_NAME" value="" />
289
+      <option name="MAIN_CLASS_NAME" value="GenericAccountTest" />
290
+      <option name="METHOD_NAME" value="test3_AccountBooks_CREDIT" />
291
+      <option name="TEST_OBJECT" value="method" />
292
+      <method v="2">
293
+        <option name="Make" enabled="true" />
294
+      </method>
295
+    </configuration>
296
+    <configuration name="GenericAccountTest.test_AccountHolder" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
297
+      <module name="Checkbook" />
298
+      <option name="PACKAGE_NAME" value="" />
299
+      <option name="MAIN_CLASS_NAME" value="GenericAccountTest" />
300
+      <option name="METHOD_NAME" value="test_AccountHolder" />
301
+      <option name="TEST_OBJECT" value="method" />
302
+      <method v="2">
303
+        <option name="Make" enabled="true" />
304
+      </method>
305
+    </configuration>
306
+    <configuration name="GenericAccountTest.test_AccountVal" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
307
+      <module name="Checkbook" />
308
+      <option name="PACKAGE_NAME" value="" />
309
+      <option name="MAIN_CLASS_NAME" value="GenericAccountTest" />
310
+      <option name="METHOD_NAME" value="test_AccountVal" />
311
+      <option name="TEST_OBJECT" value="method" />
312
+      <method v="2">
313
+        <option name="Make" enabled="true" />
314
+      </method>
315
+    </configuration>
316
+    <recent_temporary>
317
+      <list>
318
+        <item itemvalue="JUnit.All in Checkbook" />
319
+        <item itemvalue="JUnit.GenericAccountTest.test_AccountHolder" />
320
+        <item itemvalue="JUnit.GenericAccountTest" />
321
+        <item itemvalue="JUnit.GenericAccountTest.test_AccountVal" />
322
+        <item itemvalue="JUnit.GenericAccountTest.test3_AccountBooks_CREDIT" />
323
+      </list>
324
+    </recent_temporary>
325
+  </component>
326
+  <component name="SvnConfiguration">
327
+    <configuration />
328
+  </component>
329
+  <component name="TaskManager">
330
+    <task active="true" id="Default" summary="Default task">
331
+      <changelist id="7fd565bb-b6b0-477d-a84c-5bf48bedf3f5" name="Default Changelist" comment="" />
332
+      <created>1544298749432</created>
333
+      <option name="number" value="Default" />
334
+      <option name="presentableId" value="Default" />
335
+      <updated>1544298749432</updated>
336
+      <workItem from="1544298753691" duration="27322000" />
337
+    </task>
338
+    <servers />
339
+  </component>
340
+  <component name="TestHistory">
341
+    <history-entry file="GenericAccountTest_test_Transactions_ByDate - 2018.12.09 at 20h 18m 34s.xml">
342
+      <configuration name="GenericAccountTest.test_Transactions_ByDate" configurationId="JUnit" />
343
+    </history-entry>
344
+    <history-entry file="GenericAccountTest_test1_ToArray - 2018.12.09 at 20h 19m 54s.xml">
345
+      <configuration name="GenericAccountTest.test1_ToArray" configurationId="JUnit" />
346
+    </history-entry>
347
+    <history-entry file="GenericAccountTest - 2018.12.09 at 20h 27m 16s.xml">
348
+      <configuration name="GenericAccountTest" configurationId="JUnit" />
349
+    </history-entry>
350
+    <history-entry file="GenericAccountTest_test3_AccountBooks_CREDIT - 2018.12.09 at 20h 28m 14s.xml">
351
+      <configuration name="GenericAccountTest.test3_AccountBooks_CREDIT" configurationId="JUnit" />
352
+    </history-entry>
353
+    <history-entry file="GenericAccountTest - 2018.12.09 at 20h 28m 20s.xml">
354
+      <configuration name="GenericAccountTest" configurationId="JUnit" />
355
+    </history-entry>
356
+    <history-entry file="All_in_Checkbook - 2018.12.09 at 20h 28m 33s.xml">
357
+      <configuration name="All in Checkbook" configurationId="JUnit" />
358
+    </history-entry>
359
+    <history-entry file="GenericAccountTest_test_AccountVal - 2018.12.09 at 20h 31m 45s.xml">
360
+      <configuration name="GenericAccountTest.test_AccountVal" configurationId="JUnit" />
361
+    </history-entry>
362
+    <history-entry file="GenericAccountTest - 2018.12.09 at 20h 32m 03s.xml">
363
+      <configuration name="GenericAccountTest" configurationId="JUnit" />
364
+    </history-entry>
365
+    <history-entry file="All_in_Checkbook - 2018.12.09 at 20h 35m 28s.xml">
366
+      <configuration name="All in Checkbook" configurationId="JUnit" />
367
+    </history-entry>
368
+    <history-entry file="All_in_Checkbook - 2018.12.09 at 20h 36m 34s.xml">
369
+      <configuration name="All in Checkbook" configurationId="JUnit" />
370
+    </history-entry>
371
+  </component>
372
+  <component name="TimeTrackingManager">
373
+    <option name="totallyTimeSpent" value="27322000" />
374
+  </component>
375
+  <component name="ToolWindowManager">
376
+    <frame x="-345" y="-1080" width="1920" height="1080" extended-state="0" />
377
+    <editor active="true" />
378
+    <layout>
379
+      <window_info id="Image Layers" />
380
+      <window_info id="Designer" />
381
+      <window_info id="UI Designer" />
382
+      <window_info id="Capture Tool" />
383
+      <window_info id="Favorites" side_tool="true" />
384
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.13471779" />
385
+      <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
386
+      <window_info anchor="bottom" id="Messages" weight="0.32997987" />
387
+      <window_info anchor="bottom" id="Docker" show_stripe_button="false" />
388
+      <window_info anchor="bottom" id="Database Changes" />
389
+      <window_info anchor="bottom" id="Version Control" />
390
+      <window_info anchor="bottom" id="Terminal" />
391
+      <window_info anchor="bottom" id="Event Log" side_tool="true" />
392
+      <window_info anchor="bottom" id="Message" order="0" />
393
+      <window_info anchor="bottom" id="Find" order="1" />
394
+      <window_info anchor="bottom" id="Run" order="2" weight="0.47384307" />
395
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.20623742" />
396
+      <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
397
+      <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
398
+      <window_info anchor="bottom" id="TODO" order="6" />
399
+      <window_info anchor="right" id="Palette" />
400
+      <window_info anchor="right" id="Theme Preview" />
401
+      <window_info anchor="right" id="Maven" />
402
+      <window_info anchor="right" id="Capture Analysis" />
403
+      <window_info anchor="right" id="Palette&#9;" />
404
+      <window_info anchor="right" id="Database" />
405
+      <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
406
+      <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
407
+      <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
408
+    </layout>
409
+  </component>
410
+  <component name="TypeScriptGeneratedFilesManager">
411
+    <option name="version" value="1" />
412
+  </component>
413
+  <component name="editorHistoryManager">
414
+    <entry file="file://$PROJECT_DIR$/src/main/java/AccountBook.java">
415
+      <provider selected="true" editor-type-id="text-editor">
416
+        <state relative-caret-position="230">
417
+          <caret line="10" column="5" selection-start-line="10" selection-start-column="5" selection-end-line="10" selection-end-column="5" />
418
+        </state>
419
+      </provider>
420
+    </entry>
421
+    <entry file="jar:///Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/src.zip!/java/lang/reflect/InvocationTargetException.java">
422
+      <provider selected="true" editor-type-id="text-editor">
423
+        <state relative-caret-position="186">
424
+          <caret line="97" selection-start-line="97" selection-end-line="97" />
425
+          <folding>
426
+            <element signature="e#2547#2548#0" expanded="true" />
427
+          </folding>
428
+        </state>
429
+      </provider>
430
+    </entry>
431
+    <entry file="jar://$MAVEN_REPOSITORY$/junit/junit/4.0/junit-4.0.jar!/org/junit/internal/runners/TestMethodRunner.class">
432
+      <provider selected="true" editor-type-id="text-editor">
433
+        <state relative-caret-position="186">
434
+          <caret line="94" selection-start-line="94" selection-end-line="94" />
435
+        </state>
436
+      </provider>
437
+    </entry>
438
+    <entry file="file://$PROJECT_DIR$/src/main/java/Payee.java">
439
+      <provider selected="true" editor-type-id="text-editor">
440
+        <state relative-caret-position="138">
441
+          <caret line="6" column="21" selection-start-line="6" selection-start-column="21" selection-end-line="6" selection-end-column="21" />
442
+        </state>
443
+      </provider>
444
+    </entry>
445
+    <entry file="file://$PROJECT_DIR$/src/main/java/Transaction.java">
446
+      <provider selected="true" editor-type-id="text-editor">
447
+        <state relative-caret-position="131">
448
+          <caret line="9" column="24" lean-forward="true" selection-start-line="9" selection-start-column="24" selection-end-line="9" selection-end-column="24" />
449
+          <folding>
450
+            <element signature="e#1136#1137#0" expanded="true" />
451
+            <element signature="e#1221#1222#0" expanded="true" />
452
+          </folding>
453
+        </state>
454
+      </provider>
455
+    </entry>
456
+    <entry file="file://$PROJECT_DIR$/src/main/java/TransactionType.java">
457
+      <provider selected="true" editor-type-id="text-editor">
458
+        <state relative-caret-position="23">
459
+          <caret line="1" column="12" selection-start-line="1" selection-start-column="12" selection-end-line="1" selection-end-column="12" />
460
+        </state>
461
+      </provider>
462
+    </entry>
463
+    <entry file="file://$PROJECT_DIR$/src/main/java/Checkbook.java">
464
+      <provider selected="true" editor-type-id="text-editor">
465
+        <state relative-caret-position="828">
466
+          <caret line="36" column="4" selection-start-line="36" selection-start-column="4" selection-end-line="36" selection-end-column="4" />
467
+          <folding>
468
+            <element signature="imports" expanded="true" />
469
+            <element signature="e#547#548#0" expanded="true" />
470
+            <element signature="e#599#600#0" expanded="true" />
471
+            <element signature="e#766#767#0" expanded="true" />
472
+            <element signature="e#810#811#0" expanded="true" />
473
+            <element signature="e#1014#1015#0" expanded="true" />
474
+            <element signature="e#1053#1054#0" expanded="true" />
475
+            <element signature="e#1316#1317#0" expanded="true" />
476
+            <element signature="e#1355#1356#0" expanded="true" />
477
+            <element signature="e#1306#1307#0" expanded="true" />
478
+            <element signature="e#1346#1347#0" expanded="true" />
479
+            <element signature="e#1383#1384#0" expanded="true" />
480
+            <element signature="e#1421#1422#0" expanded="true" />
481
+            <element signature="e#1597#1598#0" expanded="true" />
482
+            <element signature="e#1624#1625#0" expanded="true" />
483
+          </folding>
484
+        </state>
485
+      </provider>
486
+    </entry>
487
+    <entry file="file://$PROJECT_DIR$/src/test/java/CheckbookTest.java">
488
+      <provider selected="true" editor-type-id="text-editor">
489
+        <state relative-caret-position="575">
490
+          <caret line="25" column="4" selection-start-line="25" selection-start-column="4" selection-end-line="25" selection-end-column="4" />
491
+          <folding>
492
+            <element signature="imports" expanded="true" />
493
+            <element signature="e#2986#2987#0" expanded="true" />
494
+            <element signature="e#4256#4257#0" expanded="true" />
495
+          </folding>
496
+        </state>
497
+      </provider>
498
+    </entry>
499
+    <entry file="file://$PROJECT_DIR$/src/main/java/GenericAccount.java">
500
+      <provider selected="true" editor-type-id="text-editor">
501
+        <state relative-caret-position="713">
502
+          <caret line="31" column="59" selection-start-line="31" selection-start-column="59" selection-end-line="31" selection-end-column="59" />
503
+          <folding>
504
+            <element signature="imports" expanded="true" />
505
+            <element signature="e#661#662#0" expanded="true" />
506
+            <element signature="e#710#711#0" expanded="true" />
507
+            <element signature="e#770#771#0" expanded="true" />
508
+            <element signature="e#812#813#0" expanded="true" />
509
+            <element signature="e#1118#1119#0" expanded="true" />
510
+            <element signature="e#1155#1156#0" expanded="true" />
511
+            <element signature="e#1354#1355#0" expanded="true" />
512
+            <element signature="e#1394#1395#0" expanded="true" />
513
+            <element signature="e#1439#1440#0" expanded="true" />
514
+            <element signature="e#1477#1478#0" expanded="true" />
515
+            <element signature="e#1668#1669#0" expanded="true" />
516
+            <element signature="e#1723#1724#0" expanded="true" />
517
+          </folding>
518
+        </state>
519
+      </provider>
520
+    </entry>
521
+    <entry file="file://$PROJECT_DIR$/src/test/java/GenericAccountTest.java">
522
+      <provider selected="true" editor-type-id="text-editor">
523
+        <state relative-caret-position="700">
524
+          <caret line="35" column="59" selection-start-line="35" selection-start-column="59" selection-end-line="35" selection-end-column="59" />
525
+          <folding>
526
+            <element signature="imports" expanded="true" />
527
+            <element signature="e#1323#1324#0" expanded="true" />
528
+            <element signature="e#1389#1390#0" expanded="true" />
529
+            <element signature="e#3288#3289#0" expanded="true" />
530
+          </folding>
531
+        </state>
532
+      </provider>
533
+    </entry>
534
+  </component>
535
+  <component name="masterDetails">
536
+    <states>
537
+      <state key="ArtifactsStructureConfigurable.UI">
538
+        <settings>
539
+          <artifact-editor />
540
+          <splitter-proportions>
541
+            <option name="proportions">
542
+              <list>
543
+                <option value="0.2" />
544
+              </list>
545
+            </option>
546
+          </splitter-proportions>
547
+        </settings>
548
+      </state>
549
+      <state key="FacetStructureConfigurable.UI">
550
+        <settings>
551
+          <last-edited>No facets are configured</last-edited>
552
+          <splitter-proportions>
553
+            <option name="proportions">
554
+              <list>
555
+                <option value="0.2" />
556
+              </list>
557
+            </option>
558
+          </splitter-proportions>
559
+        </settings>
560
+      </state>
561
+      <state key="GlobalLibrariesConfigurable.UI">
562
+        <settings>
563
+          <splitter-proportions>
564
+            <option name="proportions">
565
+              <list>
566
+                <option value="0.2" />
567
+              </list>
568
+            </option>
569
+          </splitter-proportions>
570
+        </settings>
571
+      </state>
572
+      <state key="JdkListConfigurable.UI">
573
+        <settings>
574
+          <last-edited>1.8</last-edited>
575
+          <splitter-proportions>
576
+            <option name="proportions">
577
+              <list>
578
+                <option value="0.2" />
579
+              </list>
580
+            </option>
581
+          </splitter-proportions>
582
+        </settings>
583
+      </state>
584
+      <state key="ModuleStructureConfigurable.UI">
585
+        <settings>
586
+          <last-edited>Checkbook</last-edited>
587
+          <splitter-proportions>
588
+            <option name="proportions">
589
+              <list>
590
+                <option value="0.2" />
591
+                <option value="0.6" />
592
+              </list>
593
+            </option>
594
+          </splitter-proportions>
595
+        </settings>
596
+      </state>
597
+      <state key="ProjectLibrariesConfigurable.UI">
598
+        <settings>
599
+          <last-edited>Maven: junit:junit:4.0</last-edited>
600
+          <splitter-proportions>
601
+            <option name="proportions">
602
+              <list>
603
+                <option value="0.2" />
604
+              </list>
605
+            </option>
606
+          </splitter-proportions>
607
+        </settings>
608
+      </state>
609
+    </states>
610
+  </component>
611
+</project>

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

@@ -5,11 +5,10 @@
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 13
     <orderEntry type="library" name="Maven: junit:junit:4.0" level="project" />
15 14
   </component>

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

@@ -1,12 +1,12 @@
1 1
 import java.time.LocalDate;
2 2
 
3 3
 public interface AccountBook {
4
-    public Integer getId();
5
-    public LocalDate getDate();
6
-    public TransactionType getType();
7
-    public String getMemo() ;
8
-    public void setMemo(String memo);
9
-    public Payee getPayee();
10
-    public void setPayee(Payee payee);
11
-    public Double getAmount();
4
+     Integer getId();
5
+     LocalDate getDate();
6
+     TransactionType getType();
7
+     String getMemo() ;
8
+     void setMemo(String memo);
9
+     Payee getPayee();
10
+     void setPayee(Payee payee);
11
+     Double getAmount();
12 12
 }

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

@@ -1,5 +1,97 @@
1
+import java.time.LocalDate;
2
+import java.util.ArrayList;
3
+import java.util.Collection;
4
+import java.util.Iterator;
5
+import java.util.List;
6
+
1 7
 public class Checkbook {
8
+    private double cash;
9
+    Payee payee;
10
+    List<Transaction> chBook;
11
+
12
+    public Checkbook(double cashAmount){
13
+        cash = cashAmount;
14
+        chBook = new ArrayList<>();
15
+    }
16
+    public Checkbook(Payee payee, double cashAmount){
17
+        this(cashAmount);
18
+        this.payee = payee;
19
+    }
20
+
21
+    public int size(){ return chBook.size(); }
22
+
23
+    public boolean isEmpty(){ return (size() == 0); }
24
+
25
+    public boolean contains(Transaction transaction){
26
+        return chBook.contains(transaction);
27
+    }
28
+
29
+    public boolean containsAll(Collection<Transaction> c){
30
+        return chBook.containsAll(c);
31
+    }
32
+
33
+    public boolean add(Transaction transaction){
34
+        cash += transaction.getAmount();
35
+        return chBook.add(transaction);
36
+    }
37
+
38
+    public void add(Transaction... transaction){
39
+        for(Transaction t : transaction)
40
+            add(t);
41
+    }
42
+
43
+    public boolean addAll(Collection<Transaction> c){
44
+        return chBook.addAll(c);
45
+    }
46
+
47
+    public boolean remove(Transaction transaction){
48
+        cash -= transaction.getAmount();
49
+        return chBook.remove(transaction);
50
+    }
51
+
52
+    public boolean removeAll(Collection<Transaction> c){
53
+        return chBook.removeAll(c);
54
+    }
55
+
56
+    public Iterator<Transaction> iterator(){
57
+        return chBook.iterator();
58
+    }
59
+
60
+    public Transaction[] toArray(){
61
+        return toArray(chBook);
62
+    }
63
+
64
+    public Transaction[] toArray(List<Transaction> transactions){
65
+        return transactions.stream().toArray(Transaction[]::new);
66
+    }
67
+
68
+    public double checkbookValue(){
69
+        return cash;
70
+    }
71
+
72
+    public Transaction[] getTransactionsForDate(LocalDate date){
73
+        return chBook.stream()
74
+                .filter(t -> t.getDate().equals(date))
75
+                .toArray(Transaction[]::new);
76
+    }
77
+
78
+    public Transaction[] getAllTransactionsForPayee(Payee payee){
79
+        return chBook.stream()
80
+                .filter(t -> t.getPayee().equals(payee))
81
+                .toArray(Transaction[]::new);
82
+    }
83
+
84
+    public Transaction[] getAllDebitTransactions(){
85
+        return chBook.stream()
86
+                .filter(t -> t.getType().equals(TransactionType.DEBIT))
87
+                .toArray(Transaction[]::new);
88
+    }
2 89
 
3
-    //blind us with your Java eloquence....
90
+    public Transaction[] getAllCreditTransactions(){
91
+        return chBook.stream()
92
+                .filter(t -> t.getType().equals(TransactionType.CREDIT))
93
+                .toArray(Transaction[]::new);
94
+    }
4 95
 
96
+    public void clear(){ chBook.clear(); }
5 97
 }

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

@@ -1,3 +1,116 @@
1
+import java.lang.reflect.Array;
2
+import java.time.LocalDate;
3
+import java.util.ArrayList;
4
+import java.util.Collection;
5
+import java.util.Iterator;
6
+import java.util.List;
7
+import java.util.stream.Collectors;
1 8
 
2
-public class GenericAccount {
9
+public class GenericAccount<T extends AccountBook>{
10
+    private double cash;
11
+    private Payee accountHolder;
12
+    private List<T> accountBook;
13
+    private Class<T> accountType;
14
+
15
+    public GenericAccount(Class<T> type) {
16
+        accountType = type;
17
+        accountBook = new ArrayList<>();
18
+        cash = 0.0;
19
+        accountHolder = new Payee();
20
+    }
21
+
22
+    public GenericAccount(Class<T> type, Payee payee) {
23
+        this(type);
24
+        accountHolder = payee;
25
+    }
26
+
27
+    public GenericAccount(Class<T> type, Payee payee, double cashAmt) {
28
+        this(type,payee);
29
+        cash = cashAmt;
30
+    }
31
+
32
+    public Payee getAccountHolder(){ return accountHolder; }
33
+
34
+    public double accountValue(){ return cash; }
35
+
36
+    public int size(){ return accountBook.size(); }
37
+
38
+    public boolean isEmpty(){ return (size() == 0); }
39
+
40
+    public boolean contains(T tVal){
41
+        return accountBook.contains(tVal);
42
+    }
43
+
44
+    public boolean containsAll(Collection<T> c){
45
+        return accountBook.containsAll(c);
46
+    }
47
+
48
+    public boolean add(T tVal){
49
+        cash += tVal.getAmount();
50
+        return accountBook.add(tVal);
51
+    }
52
+
53
+    public void add(T... tVal){
54
+        for(T item : tVal)
55
+            add(item);
56
+    }
57
+
58
+    public boolean addAll(Collection<T> c){
59
+        return accountBook.addAll(c);
60
+    }
61
+
62
+    public boolean remove(T tVal){
63
+        cash -= tVal.getAmount();
64
+        return accountBook.remove(tVal);
65
+    }
66
+
67
+    public boolean removeAll(Collection<T> c){
68
+        return accountBook.removeAll(c);
69
+    }
70
+
71
+    public Iterator<T> iterator(){
72
+        return accountBook.iterator();
73
+    }
74
+
75
+    public T[] toArray() {
76
+        return toArray(accountBook,accountType);
77
+    }
78
+
79
+    public T[] toArray(List<T> tList, Class<T> c) {
80
+        T[] array = (T[]) Array.newInstance(c, tList.size());
81
+        int index = 0;
82
+        for(T t: tList)
83
+            array[index++] = t;
84
+        return array;
85
+    }
86
+
87
+    public T[] getTransactionsForDate(LocalDate date){
88
+       List<T> list = accountBook.stream()
89
+                .filter(t -> t.getDate().equals(date))
90
+                .collect(Collectors.toList());
91
+       return toArray(list,accountType);
92
+    }
93
+
94
+    public T[] getAllTransactionsForPayee(Payee payee){
95
+        List<T> list = accountBook.stream()
96
+                .filter(t -> t.getPayee().equals(payee))
97
+                .collect(Collectors.toList());
98
+        return toArray(list,accountType);
99
+    }
100
+
101
+    public T[] getAllDebitTransactions(){
102
+        List<T> list =  accountBook.stream()
103
+                .filter(t -> t.getType().equals(TransactionType.DEBIT))
104
+                .collect(Collectors.toList());
105
+        return toArray(list,accountType);
106
+    }
107
+
108
+    public T[] getAllCreditTransactions(){
109
+        List<T> list = accountBook.stream()
110
+                .filter(t -> t.getType().equals(TransactionType.CREDIT))
111
+                .collect(Collectors.toList());
112
+        return toArray(list,accountType);
113
+    }
114
+
115
+    public void clear(){ accountBook.clear(); }
3 116
 }

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

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

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

@@ -1,9 +1,11 @@
1 1
 import java.time.LocalDate;
2
+import java.util.concurrent.atomic.AtomicInteger;
2 3
 import java.util.concurrent.atomic.AtomicReference;
3 4
 
4
-public class Transaction {
5
-    private final AtomicReference<Integer> id = new AtomicReference<Integer>();
6
-    private final AtomicReference<LocalDate> date = new AtomicReference<LocalDate>();
5
+public class Transaction implements AccountBook{
6
+    private static final AtomicInteger idNum = new AtomicInteger(0);
7
+    private final AtomicReference<Integer> id = new AtomicReference<>(idNum.incrementAndGet());
8
+    private final AtomicReference<LocalDate> date = new AtomicReference<>(LocalDate.now());
7 9
     private String memo;
8 10
     private Payee payee;
9 11
     private TransactionType typee; // Credit (reduces the checkbook), Debit (increases the checkbook)
@@ -45,9 +47,6 @@ public class Transaction {
45 47
     }
46 48
 
47 49
     public Double getAmount() {
48
-        if (this.typee == TransactionType.DEBIT) {
49
-            return amount;
50
-        }
51
-        return (-1.0 * amount);
50
+        return (this.typee == TransactionType.DEBIT) ? amount : -1.0 * amount;
52 51
     }
53 52
 }

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

@@ -1,9 +1,262 @@
1
-import static org.junit.Assert.*;
1
+import junit.framework.Assert;
2
+import org.junit.Test;
3
+import java.time.LocalDate;
4
+import java.util.ArrayList;
5
+import java.util.Arrays;
6
+import java.util.Iterator;
2 7
 
3 8
 public class CheckbookTest {
9
+    Checkbook book;
10
+    Payee connor, bob;
11
+    Transaction t1, t2, t3, t4, t5, t6, t7;
4 12
 
5 13
     @org.junit.Before
6 14
     public void setUp() throws Exception {
15
+        connor = new Payee("Connor", "Dunnigan", "Connor@gmail.com");
16
+        bob = new Payee("Bob", "Bobert", "Bob@gmail.com");
17
+        book = new Checkbook(connor, 10_000);
18
+        t1 = new Transaction("Rent", connor, TransactionType.CREDIT, 800.0);
19
+        t2 = new Transaction("Utilities", connor, TransactionType.CREDIT, 200.0);
20
+        t3 = new Transaction("Groceries", connor, TransactionType.CREDIT, 100.0);
21
+        t4 = new Transaction("Paycheck", connor, TransactionType.DEBIT, 1_000.0);
22
+        t5 = new Transaction("Side Hustle", connor, TransactionType.DEBIT, 500.0);
23
+        t6 = new Transaction("Allowance", bob, TransactionType.DEBIT, 300.0);
24
+        t7 = new Transaction("Random", bob, TransactionType.DEBIT, 100.0);
25
+    }
26
+
27
+    @Test
28
+    public void test_Size_Add() {
29
+        book.add(t1);
30
+        Assert.assertEquals(1, book.size());
31
+    }
32
+
33
+    @Test
34
+    public void test_Add_Contains() {
35
+        book.add(t1);
36
+        Assert.assertTrue(book.contains(t1));
37
+    }
38
+
39
+    @Test
40
+    public void test_Remove_Contains() {
41
+        book.add(t1);
42
+        book.add(t2);
43
+        book.remove(t1);
44
+        Assert.assertFalse(book.contains(t1));
45
+    }
46
+
47
+    @Test
48
+    public void test_RemoveAll() {
49
+        ArrayList<Transaction> list = new ArrayList<>(Arrays.asList(t1, t2, t3, t4, t5, t6));
50
+        book.addAll(list);
51
+        book.removeAll(list);
52
+        Assert.assertTrue(book.isEmpty());
53
+    }
54
+
55
+    @Test
56
+    public void test_AddAll() {
57
+        ArrayList<Transaction> list = new ArrayList<>(Arrays.asList(t1, t2, t3, t4, t5, t6));
58
+        book.addAll(list);
59
+        Assert.assertTrue(book.containsAll(list));
60
+    }
61
+
62
+    @Test
63
+    public void test2_AddAll() {
64
+        ArrayList<Transaction> list = new ArrayList<>(Arrays.asList(t1, t2));
65
+        ArrayList<Transaction> cpyList = new ArrayList<>(list);
66
+        cpyList.add(t3);
67
+        book.addAll(list);
68
+        Assert.assertFalse(book.containsAll(cpyList));
69
+    }
70
+
71
+    @Test
72
+    public void test_ContainsAll_True() {
73
+        ArrayList<Transaction> list = new ArrayList<>(Arrays.asList(t1, t2));
74
+        book.add(t1, t2);
75
+        Assert.assertTrue(book.containsAll(list));
76
+    }
77
+
78
+    @Test
79
+    public void test_ContainsAll_False() {
80
+        ArrayList<Transaction> list = new ArrayList<>(Arrays.asList(t1, t2));
81
+        ArrayList<Transaction> cpyList = new ArrayList<>(list);
82
+        cpyList.add(t3);
83
+        Assert.assertFalse(book.containsAll(cpyList));
84
+    }
85
+
86
+    @Test
87
+    public void test1_IsEmpty_False() {
88
+        book.add(t1);
89
+        Assert.assertFalse(book.isEmpty());
90
+    }
91
+
92
+    @Test
93
+    public void test2_IsEmpty_True() {
94
+        Assert.assertTrue(book.isEmpty());
95
+    }
96
+
97
+    @Test
98
+    public void test1_Iterator() {
99
+        book.add(t1, t2, t3);
100
+        Iterator<Transaction> itr = book.iterator();
101
+        Assert.assertEquals(t1, itr.next());
102
+    }
103
+
104
+    @Test
105
+    public void test2_Iterator() {
106
+        book.add(t1, t2, t3);
107
+        Iterator<Transaction> itr = book.iterator();
108
+        itr.next();
109
+        Assert.assertEquals(t2, itr.next());
110
+    }
111
+
112
+    @Test
113
+    public void test3_Iterator() {
114
+        book.add(t1, t2, t3);
115
+        Iterator<Transaction> itr = book.iterator();
116
+        itr.next();
117
+        itr.next();
118
+        Assert.assertEquals(t3, itr.next());
119
+    }
120
+
121
+    @Test
122
+    public void test1_ToArray() {
123
+        book.add(t1);
124
+        Transaction[] exp = {t1};
125
+        Assert.assertTrue(Arrays.equals(exp, book.toArray()));
126
+    }
127
+
128
+    @Test
129
+    public void test2_ToArray() {
130
+        book.add(t1, t2);
131
+        Transaction[] exp = {t1, t2};
132
+        Assert.assertTrue(Arrays.equals(exp, book.toArray()));
133
+    }
134
+
135
+    @Test
136
+    public void test3_ToArray() {
137
+        book.add(t1, t2, t3);
138
+        Transaction[] exp = {t1, t2, t3};
139
+        Assert.assertTrue(Arrays.equals(exp, book.toArray(book.chBook)));
140
+    }
141
+
142
+    @Test
143
+    public void test_checkbookVal_Default() {
144
+        Assert.assertEquals(10_000.0, book.checkbookValue());
145
+    }
146
+
147
+    @Test
148
+    public void test_checkbookVal_PostTransactions() {
149
+        book.add(t1, t2, t3);
150
+        Assert.assertEquals(8_900.0, book.checkbookValue());
151
+    }
152
+
153
+    @Test
154
+    public void test2_checkbookVal_PostTransactions() {
155
+        book.add(t1, t2, t3, t4, t5);
156
+        Assert.assertEquals(10_400.0, book.checkbookValue());
157
+    }
158
+
159
+    @Test
160
+    public void test_Transactions_ByDate() {
161
+        book.add(t1);
162
+        Transaction[] exp = {t1};
163
+        Transaction[] act = book.getTransactionsForDate(LocalDate.now());
164
+        Assert.assertTrue(Arrays.equals(exp, act));
165
+    }
166
+
167
+    @Test
168
+    public void test2_Transactions_ByDate() {
169
+        book.add(t1, t2);
170
+        Transaction[] exp = {t1, t2};
171
+        Transaction[] act = book.getTransactionsForDate(LocalDate.now());
172
+        Assert.assertTrue(Arrays.equals(exp, act));
173
+    }
174
+
175
+    @Test
176
+    public void test3_Transactions_ByDate() {
177
+        book.add(t1, t2, t3, t4, t5);
178
+        Transaction[] exp = {t1, t2, t3, t4, t5};
179
+        Transaction[] act = book.getTransactionsForDate(LocalDate.now());
180
+        Assert.assertTrue(Arrays.equals(exp, act));
181
+    }
182
+
183
+    @Test
184
+    public void test_Transactions_ByPayee() {
185
+        book.add(t1);
186
+        Transaction[] exp = {t1};
187
+        Transaction[] act = book.getAllTransactionsForPayee(connor);
188
+        Assert.assertTrue(Arrays.equals(exp, act));
189
+    }
190
+
191
+    @Test
192
+    public void test2_Transactions_ByPayee() {
193
+        book.add(t1, t2);
194
+        Transaction[] exp = {t1, t2};
195
+        Transaction[] act = book.getAllTransactionsForPayee(connor);
196
+        Assert.assertTrue(Arrays.equals(exp, act));
197
+    }
198
+
199
+    @Test
200
+    public void test3_Transactions_ByPayee() {
201
+        book.add(t1, t2, t6);
202
+        Transaction[] exp = {t1, t2};
203
+        Transaction[] act = book.getAllTransactionsForPayee(connor);
204
+        Assert.assertTrue(Arrays.equals(exp, act));
205
+    }
206
+
207
+    @Test
208
+    public void test_Transactions_DEBIT() {
209
+        book.add(t4);
210
+        Transaction[] exp = {t4};
211
+        Transaction[] act = book.getAllDebitTransactions();
212
+        Assert.assertTrue(Arrays.equals(exp, act));
213
+    }
214
+
215
+    @Test
216
+    public void test2_Transactions_DEBIT() {
217
+        book.add(t1, t2, t4);
218
+        Transaction[] exp = {t4};
219
+        Transaction[] act = book.getAllDebitTransactions();
220
+        Assert.assertTrue(Arrays.equals(exp, act));
221
+    }
222
+
223
+    @Test
224
+    public void test3_Transactions_DEBIT() {
225
+        book.add(t1, t2, t3, t4, t5, t6);
226
+        Transaction[] exp = {t4, t5, t6};
227
+        Transaction[] act = book.getAllDebitTransactions();
228
+        Assert.assertTrue(Arrays.equals(exp, act));
229
+    }
230
+
231
+    @Test
232
+    public void test_Transactions_CREDIT() {
233
+        book.add(t1);
234
+        Transaction[] exp = {t1};
235
+        Transaction[] act = book.getAllCreditTransactions();
236
+        Assert.assertTrue(Arrays.equals(exp, act));
237
+    }
238
+
239
+    @Test
240
+    public void test2_Transactions_CREDIT() {
241
+        book.add(t1, t2, t4);
242
+        Transaction[] exp = {t1, t2};
243
+        Transaction[] act = book.getAllCreditTransactions();
244
+        Assert.assertTrue(Arrays.equals(exp, act));
245
+    }
246
+
247
+    @Test
248
+    public void test3_Transactions_CREDIT() {
249
+        book.add(t1, t2, t3, t4, t5, t6);
250
+        Transaction[] exp = {t1, t2, t3};
251
+        Transaction[] act = book.getAllCreditTransactions();
252
+        Assert.assertTrue(Arrays.equals(exp, act));
253
+    }
254
+
255
+    @Test
256
+    public void test_Clear() {
257
+        book.add(t1, t2, t3);
258
+        book.clear();
259
+        Assert.assertTrue(book.isEmpty());
7 260
     }
8 261
 
9 262
     @org.junit.After

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

@@ -0,0 +1,260 @@
1
+import junit.framework.Assert;
2
+import org.junit.Test;
3
+
4
+import java.time.LocalDate;
5
+import java.util.ArrayList;
6
+import java.util.Arrays;
7
+import java.util.Iterator;
8
+
9
+public class GenericAccountTest {
10
+    GenericAccount<Transaction> book;
11
+    Payee connor, bob;
12
+    Transaction t1, t2, t3, t4, t5, t6, t7;
13
+
14
+    @org.junit.Before
15
+    public void setUp() throws Exception {
16
+        connor = new Payee("Connor", "Dunnigan", "Connor@gmail.com");
17
+        bob = new Payee("Bob", "Bobert", "Bob@gmail.com");
18
+        book = new GenericAccount<>(Transaction.class, connor, 10_000);
19
+        t1 = new Transaction("Rent", connor, TransactionType.CREDIT, 800.0);
20
+        t2 = new Transaction("Utilities", connor, TransactionType.CREDIT, 200.0);
21
+        t3 = new Transaction("Groceries", connor, TransactionType.CREDIT, 100.0);
22
+        t4 = new Transaction("Paycheck", connor, TransactionType.DEBIT, 1_000.0);
23
+        t5 = new Transaction("Side Hustle", connor, TransactionType.DEBIT, 500.0);
24
+        t6 = new Transaction("Allowance", bob, TransactionType.DEBIT, 300.0);
25
+        t7 = new Transaction("Random", bob, TransactionType.DEBIT, 100.0);
26
+    }
27
+
28
+    @Test
29
+    public void test_AccountVal() {
30
+        book.add(t1);
31
+        Assert.assertEquals(9_200.0, book.accountValue(), 0);
32
+    }
33
+
34
+    @Test
35
+    public void test_AccountHolder(){
36
+       Assert.assertEquals(connor,book.getAccountHolder());
37
+    }
38
+
39
+    @Test
40
+    public void test_Size_Add() {
41
+        book.add(t1);
42
+        Assert.assertEquals(1, book.size());
43
+    }
44
+
45
+    @Test
46
+    public void test_Add_Contains() {
47
+        book.add(t1);
48
+        Assert.assertTrue(book.contains(t1));
49
+    }
50
+
51
+    @Test
52
+    public void test_Remove_Contains() {
53
+        book.add(t1);
54
+        book.add(t2);
55
+        book.remove(t1);
56
+        Assert.assertFalse(book.contains(t1));
57
+    }
58
+
59
+    @Test
60
+    public void test_RemoveAll() {
61
+        ArrayList<Transaction> list = new ArrayList<>(Arrays.asList(t1, t2, t3, t4, t5, t6));
62
+        book.addAll(list);
63
+        book.removeAll(list);
64
+        Assert.assertTrue(book.isEmpty());
65
+    }
66
+
67
+    @Test
68
+    public void test_AddAll() {
69
+        ArrayList<Transaction> list = new ArrayList<>(Arrays.asList(t1, t2, t3, t4, t5, t6));
70
+        book.addAll(list);
71
+        Assert.assertTrue(book.containsAll(list));
72
+    }
73
+
74
+    @Test
75
+    public void test2_AddAll() {
76
+        ArrayList<Transaction> list = new ArrayList<>(Arrays.asList(t1, t2));
77
+        ArrayList<Transaction> cpyList = new ArrayList<>(list);
78
+        cpyList.add(t3);
79
+        book.addAll(list);
80
+        Assert.assertFalse(book.containsAll(cpyList));
81
+    }
82
+
83
+    @Test
84
+    public void test_ContainsAll_True() {
85
+        ArrayList<Transaction> list = new ArrayList<>(Arrays.asList(t1, t2));
86
+        book.add(t1, t2);
87
+        Assert.assertTrue(book.containsAll(list));
88
+    }
89
+
90
+    @Test
91
+    public void test_ContainsAll_False() {
92
+        ArrayList<Transaction> list = new ArrayList<>(Arrays.asList(t1, t2));
93
+        ArrayList<Transaction> cpyList = new ArrayList<>(list);
94
+        cpyList.add(t3);
95
+        Assert.assertFalse(book.containsAll(cpyList));
96
+    }
97
+
98
+    @Test
99
+    public void test1_IsEmpty_False() {
100
+        book.add(t1);
101
+        Assert.assertFalse(book.isEmpty());
102
+    }
103
+
104
+    @Test
105
+    public void test2_IsEmpty_True() {
106
+        Assert.assertTrue(book.isEmpty());
107
+    }
108
+
109
+    @Test
110
+    public void test1_Iterator() {
111
+        book.add(t1, t2, t3);
112
+        Iterator<Transaction> itr = book.iterator();
113
+        Assert.assertEquals(t1, itr.next());
114
+    }
115
+
116
+    @Test
117
+    public void test2_Iterator() {
118
+        book.add(t1, t2, t3);
119
+        Iterator<Transaction> itr = book.iterator();
120
+        itr.next();
121
+        Assert.assertEquals(t2, itr.next());
122
+    }
123
+
124
+    @Test
125
+    public void test3_Iterator() {
126
+        book.add(t1, t2, t3);
127
+        Iterator<Transaction> itr = book.iterator();
128
+        itr.next();
129
+        itr.next();
130
+        Assert.assertEquals(t3, itr.next());
131
+    }
132
+
133
+    @Test
134
+    public void test1_ToArray() {
135
+        book.add(t1);
136
+        AccountBook[] exp = {t1};
137
+        Assert.assertTrue(Arrays.equals(exp, book.toArray()));
138
+    }
139
+
140
+    @Test
141
+    public void test2_ToArray() {
142
+        book.add(t1, t2);
143
+        AccountBook[] exp = {t1, t2};
144
+        Assert.assertTrue(Arrays.equals(exp, book.toArray()));
145
+    }
146
+
147
+    @Test
148
+    public void test3_ToArray() {
149
+        book.add(t1, t2, t3);
150
+        AccountBook[] exp = {t1, t2, t3};
151
+        Assert.assertTrue(Arrays.equals(exp, book.toArray()));
152
+    }
153
+
154
+    @Test
155
+    public void test_AccountBooks_ByDate() {
156
+        book.add(t1);
157
+        AccountBook[] exp = {t1};
158
+        AccountBook[] act = book.getTransactionsForDate(LocalDate.now());
159
+        Assert.assertTrue(Arrays.equals(exp, act));
160
+    }
161
+
162
+    @Test
163
+    public void test2_AccountBooks_ByDate() {
164
+        book.add(t1, t2);
165
+        AccountBook[] exp = {t1, t2};
166
+        AccountBook[] act = book.getTransactionsForDate(LocalDate.now());
167
+        Assert.assertTrue(Arrays.equals(exp, act));
168
+    }
169
+
170
+    @Test
171
+    public void test3_AccountBooks_ByDate() {
172
+        book.add(t1, t2, t3, t4, t5);
173
+        AccountBook[] exp = {t1, t2, t3, t4, t5};
174
+        AccountBook[] act = book.getTransactionsForDate(LocalDate.now());
175
+        Assert.assertTrue(Arrays.equals(exp, act));
176
+    }
177
+
178
+    @Test
179
+    public void test_AccountBooks_ByPayee() {
180
+        book.add(t1);
181
+        AccountBook[] exp = {t1};
182
+        AccountBook[] act = book.getAllTransactionsForPayee(connor);
183
+        Assert.assertTrue(Arrays.equals(exp, act));
184
+    }
185
+
186
+    @Test
187
+    public void test2_AccountBooks_ByPayee() {
188
+        book.add(t1, t2);
189
+        AccountBook[] exp = {t1, t2};
190
+        AccountBook[] act = book.getAllTransactionsForPayee(connor);
191
+        Assert.assertTrue(Arrays.equals(exp, act));
192
+    }
193
+
194
+    @Test
195
+    public void test3_AccountBooks_ByPayee() {
196
+        book.add(t1, t2, t6);
197
+        AccountBook[] exp = {t1, t2};
198
+        AccountBook[] act = book.getAllTransactionsForPayee(connor);
199
+        Assert.assertTrue(Arrays.equals(exp, act));
200
+    }
201
+
202
+    @Test
203
+    public void test_AccountBooks_DEBIT() {
204
+        book.add(t4);
205
+        AccountBook[] exp = {t4};
206
+        AccountBook[] act = book.getAllDebitTransactions();
207
+        Assert.assertTrue(Arrays.equals(exp, act));
208
+    }
209
+
210
+    @Test
211
+    public void test2_AccountBooks_DEBIT() {
212
+        book.add(t1, t2, t4);
213
+        AccountBook[] exp = {t4};
214
+        AccountBook[] act = book.getAllDebitTransactions();
215
+        Assert.assertTrue(Arrays.equals(exp, act));
216
+    }
217
+
218
+    @Test
219
+    public void test3_AccountBooks_DEBIT() {
220
+        book.add(t1, t2, t3, t4, t5, t6);
221
+        AccountBook[] exp = {t4, t5, t6};
222
+        AccountBook[] act = book.getAllDebitTransactions();
223
+        Assert.assertTrue(Arrays.equals(exp, act));
224
+    }
225
+
226
+    @Test
227
+    public void test_AccountBooks_CREDIT() {
228
+        book.add(t1);
229
+        AccountBook[] exp = {t1};
230
+        AccountBook[] act = book.getAllCreditTransactions();
231
+        Assert.assertTrue(Arrays.equals(exp, act));
232
+    }
233
+
234
+    @Test
235
+    public void test2_AccountBooks_CREDIT() {
236
+        book.add(t1, t2, t4);
237
+        AccountBook[] exp = {t1, t2};
238
+        AccountBook[] act = book.getAllCreditTransactions();
239
+        Assert.assertTrue(Arrays.equals(exp, act));
240
+    }
241
+
242
+    @Test
243
+    public void test3_AccountBooks_CREDIT() {
244
+        book.add(t1, t2, t3, t4, t5, t6);
245
+        AccountBook[] exp = {t1, t2, t3};
246
+        AccountBook[] act = book.getAllCreditTransactions();
247
+        Assert.assertTrue(Arrays.equals(exp, act));
248
+    }
249
+
250
+    @Test
251
+    public void test_Clear() {
252
+        book.add(t1, t2, t3);
253
+        book.clear();
254
+        Assert.assertTrue(book.isEmpty());
255
+    }
256
+
257
+    @org.junit.After
258
+    public void tearDown() throws Exception {
259
+    }
260
+}