forked from ivahaev/amigo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
amigo_test.go
31 lines (29 loc) · 956 Bytes
/
amigo_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
package amigo
import (
"testing"
)
func TestAmigo(t *testing.T) {
t.Run("#New", func(t *testing.T) {
t.Run("should return pointer to a new Amigo struct with username and password filled and default host and port settings", func(t *testing.T) {
a := New(&Settings{Username: "username", Password: "secret"})
if a.settings.Username != "username" {
t.Fatal("username mismatched")
}
if a.settings.Password != "secret" {
t.Fatal("secret mismatched")
}
})
t.Run("should return pointer to a new Amigo struct with username and password filled and provided host and default port settings", func(t *testing.T) {
a := New(&Settings{Username: "username", Password: "secret", Host: "amigo"})
if a.settings.Username != "username" {
t.Fatal("username mismatched")
}
if a.settings.Password != "secret" {
t.Fatal("secret mismatched")
}
if a.settings.Host != "amigo" {
t.Fatal("host mismatched")
}
})
})
}