-
Notifications
You must be signed in to change notification settings - Fork 0
/
client_test.go
31 lines (29 loc) · 900 Bytes
/
client_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 foxyproxy
import "testing"
func TestNewClient(t *testing.T) {
const (
domainHeader = "example-inc"
endpointBaseURL = "https://reseller.example-inc.api.foxyproxy.com"
username = "admin"
password = "12345"
)
ncp := NewClientParams{
DomainHeader: domainHeader,
EndpointBaseURL: endpointBaseURL,
Username: username,
Password: password,
}
c := NewClient(&ncp)
if c.domainHeader != domainHeader {
t.Errorf("expected client domain header: %s, got %s", domainHeader, c.domainHeader)
}
if c.endpointBaseURL != endpointBaseURL {
t.Errorf("expected client endpoint base url: %s, got %s", endpointBaseURL, c.endpointBaseURL)
}
if c.username != username {
t.Errorf("expected client username: %s, got %s", username, c.username)
}
if c.password != password {
t.Errorf("expected client password: %s, got %s", password, c.password)
}
}