-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsession_test.go
43 lines (26 loc) · 926 Bytes
/
session_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 stretchr
import (
"github.com/stretchr/sdk-go/api"
"github.com/stretchr/testify/assert"
"testing"
)
func TestSession_NewSession(t *testing.T) {
s := NewSession("project", "company", "123")
assert.NotNil(t, s, "NewSession")
assert.Equal(t, "project", s.underlyingSession.Project())
assert.Equal(t, "company", s.underlyingSession.Account())
}
func TestSession_Project(t *testing.T) {
s := NewSession("project", "company", "123")
assert.Equal(t, "project", s.Project())
}
func TestSession_Account(t *testing.T) {
s := NewSession("project", "company", "123")
assert.Equal(t, "company", s.Account())
}
func TestSession_SetTransporter(t *testing.T) {
s := NewSession("project", "company", "123")
newTransporter := new(api.LiveTransporter)
assert.Equal(t, s.SetTransporter(newTransporter), s, "SetTransporter should chain")
assert.Equal(t, newTransporter, s.underlyingSession.Transporter())
}