-
Notifications
You must be signed in to change notification settings - Fork 2
/
investing_test.go
36 lines (33 loc) · 1.46 KB
/
investing_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
package investing_test
import (
"fmt"
"testing"
"time"
"github.com/niubaoshu/investing"
)
func TestInvesting(t *testing.T) {
pairId := []int{
23962, 23878, 23862, 24029, 25275, 29227, 23778, 23693, 23983, 24014, 29256, 23738, 23901, 23792, 23974, 23923, 29292, 23806,
23673, 23705, 23700, 23701, 23706, 23702, 23703, 23704, 8824, 28930, 8828, 8867, 8853, 8826, 8984, 8858, 8859, 8874, 8839, 8838,
8873, 8918, 8831, 8862, 8916, 8869, 8849, 8917, 69, 68, 8883, 8910, 47, 48, 49, 50, 5, 49798, 14, 51, 15, 16, 10, 156, 44, 6, 117,
9, 37, 52, 46, 61, 66, 1, 53, 54, 12, 11, 55, 2, 142, 56, 58, 8, 145, 75, 7, 4, 961728, 103, 43, 155, 91, 3, 39, 59, 40, 962711,
41, 42, 18, 17, 78, 171, 44399, 39929, 17920, 26491, 40828, 167, 29078, 172, 38011, 27254, 951248, 178, 29049, 37426, 13666, 20,
14958, 49692, 24441, 166, 11319, 27, 169, 8833, 1817, 1893, 1740, 1623, 1486, 2103, 40823, 44336, 8884, 8836, 959211, 49768, 959208,
8830, 1010797, 1010798, 53081, 53083, 1010800, 1010799, 1010883, 1010785, 1010782, 29231, 29232, 29233, 29234, 29235, 23960, 956470,
959207, 959209, 44486, 1031727, 1031048, 1031042, 525, 505, 510, 40681, 44794, 9227, 38181, 9236, 23894, 23896, 63, 147, 152, 153, 154,
157, 160, 1726, 1809, 1524,
}
c := investing.NewClient(pairId, 50, 2*time.Second)
if err := c.Start(); err != nil {
t.Error(err)
}
for {
select {
case <-c.Chan:
fmt.Println(c.Receive())
default:
fmt.Println(c.GetErrors())
}
time.Sleep(time.Second)
}
}