|
@@ -21,6 +21,8 @@ public class CheckbookTest {
|
21
|
21
|
public void setUp() throws Exception {
|
22
|
22
|
this.owner = new Payee();
|
23
|
23
|
owner.setGivenName("Nick Satinover");
|
|
24
|
+ owner.setFamilyName("Simpsons");
|
|
25
|
+ owner.setEmailAddress("nsatinover@gmail.com");
|
24
|
26
|
this.payeeCredit = new Payee();
|
25
|
27
|
payeeCredit.setGivenName("Credit Payee");
|
26
|
28
|
this.payeeDebit = new Payee();
|
|
@@ -235,14 +237,32 @@ public class CheckbookTest {
|
235
|
237
|
Assert.assertEquals(expected, actual);
|
236
|
238
|
}
|
237
|
239
|
|
238
|
|
-// @Test
|
239
|
|
-// public void test1GetTransactionsForDate(){
|
240
|
|
-// checkbook.add(credit);
|
241
|
|
-// checkbook.add(debit);
|
242
|
|
-// Transaction[] retarr = checkbook.getTransactionsForDate(LocalDate.now());
|
243
|
|
-// Transaction expected = credit;
|
244
|
|
-// Assert.assertEquals(expected, retarr[1]);
|
245
|
|
-// }
|
|
240
|
+ @Test
|
|
241
|
+ public void test1GetTransactionsForDate(){
|
|
242
|
+ checkbook.add(credit);
|
|
243
|
+ checkbook.add(debit);
|
|
244
|
+ Transaction[] retarr = checkbook.getTransactionsForDate(LocalDate.now());
|
|
245
|
+ Transaction expected = credit;
|
|
246
|
+ Assert.assertEquals(expected, retarr[0]);
|
|
247
|
+ }
|
|
248
|
+
|
|
249
|
+ @Test
|
|
250
|
+ public void test2GetTransactionsForDate(){
|
|
251
|
+ checkbook.add(credit);
|
|
252
|
+ checkbook.add(debit);
|
|
253
|
+ Transaction[] retarr = checkbook.getTransactionsForDate(LocalDate.now());
|
|
254
|
+ Transaction expected = debit;
|
|
255
|
+ Assert.assertEquals(expected, retarr[1]);
|
|
256
|
+ }
|
|
257
|
+
|
|
258
|
+ @Test
|
|
259
|
+ public void test3GetTransactionsForDate(){
|
|
260
|
+ checkbook.add(debit);
|
|
261
|
+ Transaction[] retarr = checkbook.getTransactionsForDate(LocalDate.now());
|
|
262
|
+ LocalDate expected = debit.getDate();
|
|
263
|
+ LocalDate actual = retarr[0].getDate(); // LocalDate.of(2018, 12, 8);
|
|
264
|
+ Assert.assertEquals(expected, actual);
|
|
265
|
+ }
|
246
|
266
|
|
247
|
267
|
@Test
|
248
|
268
|
public void test1GetAllTransactionsForPayee(){
|