mirror of
https://github.com/aclindsa/moneygo.git
synced 2024-12-26 23:42:29 -05:00
testing: Add more data
This commit is contained in:
parent
2246a4bff9
commit
9b00bc8db1
@ -138,7 +138,12 @@ func TestUpdateAccount(t *testing.T) {
|
|||||||
|
|
||||||
curr.Name = "blah"
|
curr.Name = "blah"
|
||||||
curr.Type = handlers.Payable
|
curr.Type = handlers.Payable
|
||||||
curr.SecurityId = d.securities[1].SecurityId
|
for _, s := range d.securities {
|
||||||
|
if s.UserId == curr.UserId {
|
||||||
|
curr.SecurityId = s.SecurityId
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
a, err := updateAccount(d.clients[orig.UserId], &curr)
|
a, err := updateAccount(d.clients[orig.UserId], &curr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -61,6 +61,7 @@ func (t *TestData) initUser(user *User, userid int) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
t.clients = append(t.clients, client)
|
t.clients = append(t.clients, client)
|
||||||
|
|
||||||
// TODO initialize everything else owned by this user in the TestData struct
|
// TODO initialize everything else owned by this user in the TestData struct
|
||||||
@ -170,6 +171,15 @@ var data = []TestData{
|
|||||||
Type: handlers.Stock,
|
Type: handlers.Stock,
|
||||||
AlternateId: "78462F103",
|
AlternateId: "78462F103",
|
||||||
},
|
},
|
||||||
|
handlers.Security{
|
||||||
|
UserId: 1,
|
||||||
|
Name: "EUR",
|
||||||
|
Description: "Euro",
|
||||||
|
Symbol: "€",
|
||||||
|
Precision: 2,
|
||||||
|
Type: handlers.Currency,
|
||||||
|
AlternateId: "978",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
accounts: []handlers.Account{
|
accounts: []handlers.Account{
|
||||||
handlers.Account{
|
handlers.Account{
|
||||||
@ -207,6 +217,20 @@ var data = []TestData{
|
|||||||
Type: handlers.Expense,
|
Type: handlers.Expense,
|
||||||
Name: "Cable",
|
Name: "Cable",
|
||||||
},
|
},
|
||||||
|
handlers.Account{
|
||||||
|
UserId: 1,
|
||||||
|
SecurityId: 2,
|
||||||
|
ParentAccountId: -1,
|
||||||
|
Type: handlers.Asset,
|
||||||
|
Name: "Assets",
|
||||||
|
},
|
||||||
|
handlers.Account{
|
||||||
|
UserId: 1,
|
||||||
|
SecurityId: 2,
|
||||||
|
ParentAccountId: -1,
|
||||||
|
Type: handlers.Expense,
|
||||||
|
Name: "Expenses",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
transactions: []handlers.Transaction{
|
transactions: []handlers.Transaction{
|
||||||
handlers.Transaction{
|
handlers.Transaction{
|
||||||
@ -247,6 +271,25 @@ var data = []TestData{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
handlers.Transaction{
|
||||||
|
UserId: 1,
|
||||||
|
Description: "Gas",
|
||||||
|
Date: time.Date(2017, time.November, 1, 13, 19, 50, 0, time.UTC),
|
||||||
|
Splits: []*handlers.Split{
|
||||||
|
&handlers.Split{
|
||||||
|
Status: handlers.Reconciled,
|
||||||
|
AccountId: 5,
|
||||||
|
SecurityId: -1,
|
||||||
|
Amount: "-24.56",
|
||||||
|
},
|
||||||
|
&handlers.Split{
|
||||||
|
Status: handlers.Entered,
|
||||||
|
AccountId: 6,
|
||||||
|
SecurityId: -1,
|
||||||
|
Amount: "24.56",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user