-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete bills #8
Delete bills #8
Changes from 4 commits
66040bb
f1e4ea1
c4c5627
68a0a18
cc5860b
1189594
ee2f22b
5381c7f
ad90115
ba9bea4
4758bb1
c7db496
fb56bb7
3be7fff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package io.nobt.core; | ||
|
||
public class UnknownExpenseException extends RuntimeException { | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ALTER TABLE expenses | ||
ADD deleted BOOLEAN; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sollten wir das vielleicht NOT NULL machen und alle anderen explizit auf false setzen? |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,14 +136,17 @@ public void savingAndFetchingResultsInDifferentInstance() throws Exception { | |
} | ||
|
||
@Test | ||
public void shouldRemoveOrphanExpense() throws Exception { | ||
public void shouldDeleteExpense() throws Exception { | ||
|
||
final Share thomasShare = ShareFactory.randomShare(thomas); | ||
final Share matthiasShare = ShareFactory.randomShare(matthias); | ||
final LocalDate expenseDate = LocalDate.now(); | ||
|
||
final Nobt nobtToSave = aNobt() | ||
.withExpenses(anExpense().withDebtee(thomas).withShares(thomasShare, matthiasShare).happendOn(expenseDate)) | ||
.withExpenses(anExpense() | ||
.withDebtee(thomas) | ||
.withShares(thomasShare, matthiasShare) | ||
.happendOn(expenseDate)) | ||
.build(); | ||
|
||
final NobtId id = save(nobtToSave); | ||
|
@@ -156,12 +159,14 @@ public void shouldRemoveOrphanExpense() throws Exception { | |
|
||
save(retrievedNobt); | ||
|
||
|
||
final Nobt nobtWithoutExpense = fetch(id); | ||
|
||
assertThat(nobtWithoutExpense, hasExpenses( | ||
iterableWithSize(0) | ||
)); | ||
assertThat(nobtWithoutExpense, hasDeletedExpenses( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Die beiden Assertions kannst du zusammenfassen auf ein: |
||
iterableWithSize(1) | ||
)); | ||
} | ||
|
||
@Test | ||
|
@@ -211,4 +216,5 @@ private NobtId save(Nobt nobtToSave) { | |
private Nobt fetch(NobtId id) { | ||
return invoker.invoke(new RetrieveNobtCommand(id)); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funktioniert der Referenzvergleich hier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ja, ist ein primitive type