-
Notifications
You must be signed in to change notification settings - Fork 2
/
user_test.go
37 lines (31 loc) · 874 Bytes
/
user_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
package kiteapi
import (
"testing"
)
func (ts *TestSuite) TestGetUserProfile(t *testing.T) {
t.Parallel()
profile, err := ts.KiteConnect.GetUserProfile()
if err != nil || profile.Email == "" {
t.Errorf("Error while reading user profile. Error: %v", err)
}
}
func (ts *TestSuite) TestGetUserMargins(t *testing.T) {
t.Parallel()
margins, err := ts.KiteConnect.GetUserMargins()
if err != nil {
t.Errorf("Error while reading user margins. Error: %v", err)
}
if !margins.Equity.Enabled || !margins.Commodity.Enabled {
t.Errorf("Incorrect margin values.")
}
}
func (ts *TestSuite) TestGetUserSegmentMargins(t *testing.T) {
t.Parallel()
margins, err := ts.KiteConnect.GetUserSegmentMargins("test")
if err != nil {
t.Errorf("Error while reading user margins. Error: %v", err)
}
if !margins.Enabled {
t.Errorf("Incorrect segment margin values.")
}
}