Skip to content

Commit

Permalink
Add tests for GitHub issue #506 bug
Browse files Browse the repository at this point in the history
Test that opening a multi-currency transaction and saving it again should not modify the transaction
Test that opening a multicurrency transaction and then changing it to be no longer multi-currency should maintain consistent amount for the split value and quantity

Fix getImbalance() method of transactions to ignore multicurrency transactions.
  • Loading branch information
codinguser committed Aug 3, 2016
1 parent ec23d69 commit edf7ae5
Show file tree
Hide file tree
Showing 4 changed files with 247 additions and 44 deletions.

2 comments on commit edf7ae5

@rivaldi8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in Transaction.java would be better in a separate commit, as they are not related to adding tests for the issue.

I'm adding some comments like this about commit. You can just ignore them :) I'm just pointing out some things that make it more difficult to review, specially in the future, once merged.

@codinguser
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments are good 👍 :)
I think I made this change because I realized there was a bug which was making a test not to function as expected. The createImbalanceSplit promises to return zero for multi-currency transactions, but this was not the case. It was checking the value, not the quantity of the split as test for multicurrency.
This was having undesired side-effects in the test

Please sign in to comment.