1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-05 21:58:39 -04:00

testing: Add account tests

This commit is contained in:
2017-10-11 21:19:14 -04:00
parent 52ee17dae8
commit a399d75124
3 changed files with 182 additions and 2 deletions

View File

@ -87,6 +87,18 @@ func (t *TestData) Initialize() (*TestData, error) {
t2.securities = append(t2.securities, *s2)
}
for i, account := range t.accounts {
account.SecurityId = t2.securities[t.accounts[i].SecurityId].SecurityId
if account.ParentAccountId != -1 {
account.ParentAccountId = t2.accounts[t.accounts[i].AccountId].AccountId
}
a2, err := createAccount(t2.clients[account.UserId], &account)
if err != nil {
return nil, err
}
t2.accounts = append(t2.accounts, *a2)
}
t2.initialized = true
return &t2, nil
}