-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpool_options_test.go
51 lines (38 loc) · 966 Bytes
/
pool_options_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
44
45
46
47
48
49
50
51
package elgo
import (
"testing"
"time"
)
func TestWithIncreaseIntervals(t *testing.T) {
t.Parallel()
var (
want = 1000.
pool = NewPool(WithIncreasePlayerBorderBy(want))
)
t.Cleanup(func() { pool.Close() })
if pool.playersBordersIncreaseBy != want {
t.Errorf("want playersBordersIncreaseBy %f, got %f", want, pool.playersBordersIncreaseBy)
}
}
func TestWithPlayerRetry(t *testing.T) {
t.Parallel()
var (
want = 3 * time.Hour
pool = NewPool(WithPlayerRetryInterval(want))
)
t.Cleanup(func() { pool.Close() })
if pool.playerRetryInterval != want {
t.Errorf("want playerRetryInterval %d, got %d", want, pool.playerRetryInterval)
}
}
func TestWithGlobalRetry(t *testing.T) {
t.Parallel()
var (
want = 3 * time.Hour
pool = NewPool(WithGlobalRetryInterval(want))
)
t.Cleanup(func() { pool.Close() })
if pool.globalRetryInterval != want {
t.Errorf("want globalRetryInterval %d, got %d", want, pool.globalRetryInterval)
}
}