1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-02 04:18:38 -04:00

testing: Ensure account balance is correct after OFX import

This commit is contained in:
2017-11-26 21:01:26 -05:00
parent aa8924243e
commit d656f15e84
3 changed files with 20 additions and 17 deletions

View File

@ -202,6 +202,18 @@ func uploadFile(client *http.Client, filename, urlsuffix string) error {
return nil
}
func accountBalanceHelper(t *testing.T, client *http.Client, account *handlers.Account, balance string) {
t.Helper()
transactions, err := getAccountTransactions(client, account.AccountId, 0, 0, "")
if err != nil {
t.Fatalf("Couldn't fetch account transactions for '%s': %s\n", account.Name, err)
}
if transactions.EndingBalance != balance {
t.Errorf("Expected ending balance for '%s' to be '%s', but found %s\n", account.Name, balance, transactions.EndingBalance)
}
}
func RunWith(t *testing.T, d *TestData, fn TestDataFunc) {
testdata, err := d.Initialize()
if err != nil {