|
1 | 1 | package comdirect |
2 | 2 |
|
3 | | -import ( |
4 | | - "fmt" |
5 | | - "os" |
6 | | - "testing" |
7 | | -) |
| 3 | +import "testing" |
8 | 4 |
|
9 | | -func TestClient_AccountBalances(t *testing.T) { |
10 | | - client := getClientFromEnv() |
11 | | - auth, err := client.Authenticate() |
12 | | - if err != nil { |
13 | | - t.Errorf("failed to authenticate: %s", err) |
14 | | - } |
15 | | - fmt.Printf("%+v\n", auth) |
16 | | - balances, err := client.Balances() |
17 | | - if err != nil { |
18 | | - t.Errorf("failed to exchange account balances %s", err) |
19 | | - } |
20 | | - |
21 | | - fmt.Printf("%+v\n", balances) |
22 | | - |
23 | | - auth, err = client.Refresh() |
24 | | - if err != nil { |
25 | | - return |
26 | | - } |
27 | | - fmt.Printf("%+v\n", auth) |
28 | | - |
29 | | - err = client.Revoke() |
30 | | - if err != nil { |
31 | | - return |
32 | | - } |
33 | | - fmt.Println("successfully revoked access token") |
| 5 | +func TestNewWithAuthenticator(t *testing.T) { |
| 6 | + // TODO |
34 | 7 | } |
35 | 8 |
|
36 | | -func TestClient_Balance(t *testing.T) { |
37 | | - client := getClientFromEnv() |
38 | | - accountId := os.Getenv("COMDIRECT_ACCOUNT_ID") |
39 | | - _, err := client.Balance(accountId) |
40 | | - |
41 | | - if err != nil { |
42 | | - t.Errorf("failed to exchange account balance %s", err) |
43 | | - return |
44 | | - } |
| 9 | +func TestNewWithAuthOptions(t *testing.T) { |
| 10 | + // TODO |
45 | 11 | } |
46 | 12 |
|
47 | | -func TestClient_Transactions(t *testing.T) { |
48 | | - client := getClientFromEnv() |
49 | | - accountId := os.Getenv("COMDIRECT_ACCOUNT_ID") |
50 | | - transactions, err := client.Transactions(accountId) |
51 | | - |
52 | | - if err != nil { |
53 | | - t.Errorf("failed to exchange account balance %s", err) |
54 | | - return |
55 | | - } |
56 | | - |
57 | | - for _, t := range transactions { |
58 | | - fmt.Printf("%v\n", t) |
59 | | - } |
| 13 | +func TestClient_Authenticate(t *testing.T) { |
| 14 | + // TODO |
60 | 15 | } |
61 | 16 |
|
62 | | -func getClientFromEnv() *Client { |
63 | | - |
64 | | - options := &AuthOptions{ |
65 | | - Username: os.Getenv("COMDIRECT_USERNAME"), |
66 | | - Password: os.Getenv("COMDIRECT_PASSWORD"), |
67 | | - ClientId: os.Getenv("COMDIRECT_CLIENT_ID"), |
68 | | - ClientSecret: os.Getenv("COMDIRECT_CLIENT_SECRET"), |
69 | | - } |
| 17 | +func TestClient_Refresh(t *testing.T) { |
| 18 | + // TODO |
| 19 | +} |
70 | 20 |
|
71 | | - return NewWithAuthOptions(options) |
| 21 | +func TestClient_Revoke(t *testing.T) { |
| 22 | + // TODO |
72 | 23 | } |
0 commit comments