-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaccount_group_test.go
More file actions
57 lines (44 loc) · 1.02 KB
/
account_group_test.go
File metadata and controls
57 lines (44 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package api_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/lieut-data/go-moneywell/api"
)
func TestGetAccountGroups(t *testing.T) {
t.Parallel()
database, err := api.OpenDocument("Test.moneywell")
assert.NoError(t, err)
defer database.Close()
accountGroups, err := api.GetAccountGroups(database)
assert.NoError(t, err)
expectedAccountGroups := []api.AccountGroup{
{
PrimaryKey: 2,
Name: "Bank",
},
{
PrimaryKey: 1,
Name: "Other Bank",
},
}
assert.Equal(t, expectedAccountGroups, accountGroups)
}
func TestGetAccountGroupsMap(t *testing.T) {
t.Parallel()
database, err := api.OpenDocument("Test.moneywell")
assert.NoError(t, err)
defer database.Close()
accountGroups, err := api.GetAccountGroupsMap(database)
assert.NoError(t, err)
expectedAccountGroups := map[int64]api.AccountGroup{
2: {
PrimaryKey: 2,
Name: "Bank",
},
1: {
PrimaryKey: 1,
Name: "Other Bank",
},
}
assert.Equal(t, expectedAccountGroups, accountGroups)
}