-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfiGoConnection_test.go
43 lines (34 loc) · 1.32 KB
/
fiGoConnection_test.go
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
package fiGo_test
import (
"testing"
"github.com/TobiEiss/fiGo"
)
func TestConnection(t *testing.T) {
var connection fiGo.IConnection
figoConnection := fiGo.NewFigoConnection("CaESKmC8MAhNpDe5rvmWnSkRE_7pkkVIIgMwclgzGcQY", "STdzfv0GXtEj_bwYn7AgCVszN1kKq5BdgEIKOM_fzybQ")
connection = figoConnection
_, err := connection.CreateUser("testUsername", "[email protected]", "mysecretpassword")
if err != fiGo.ErrHTTPUnauthorized {
t.Fail()
}
}
func TestLogin(t *testing.T) {
var connection fiGo.IConnection
figoConnection := fiGo.NewFigoConnection("CaESKmC8MAhNpDe5rvmWnSkRE_7pkkVIIgMwclgzGcQY", "STdzfv0GXtEj_bwYn7AgCVszN1kKq5BdgEIKOM_fzybQ")
connection = figoConnection
_, err := connection.CredentialLogin("[email protected]", "demo1234")
if err != fiGo.ErrHTTPUnauthorized {
t.Fail()
}
}
func TestSetupNewBankAccount(t *testing.T) {
var connection fiGo.IConnection
figoConnection := fiGo.NewFigoConnection("CaESKmC8MAhNpDe5rvmWnSkRE_7pkkVIIgMwclgzGcQY", "STdzfv0GXtEj_bwYn7AgCVszN1kKq5BdgEIKOM_fzybQ")
connection = figoConnection
value := "ASHWLIkouP2O6_bgA2wWReRhletgWKHYjLqDaqb0LFfamim9RjexTo22ujRIP_cjLiRiSyQXyt2kM1eXU2XLFZQ0Hro15HikJQT_eNeT_9XQ"
jsonAnswer, err := connection.SetupNewBankAccount(value, "90090042", "de", []string{"demo", "demo"})
if err != fiGo.ErrHTTPUnauthorized {
t.Fail()
}
t.Log(string(jsonAnswer))
}