Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package smobilpay |
||
2 | |||
3 | import ( |
||
4 | "testing" |
||
5 | "time" |
||
6 | |||
7 | "github.com/stretchr/testify/assert" |
||
8 | ) |
||
9 | |||
10 | func TestWithTimestamp(t *testing.T) { |
||
11 | // Setup |
||
12 | t.Parallel() |
||
13 | |||
14 | // Arrange |
||
15 | config := defaultRequestConfig() |
||
16 | timestamp := time.Now().Add(1 * time.Hour) |
||
17 | |||
18 | // Act |
||
19 | WithRequestTimestamp(timestamp).apply(config) |
||
20 | |||
21 | // Assert |
||
22 | assert.Equal(t, timestamp, config.timestamp) |
||
23 | } |
||
24 | |||
25 | func TestWithNonce(t *testing.T) { |
||
26 | // Setup |
||
27 | t.Parallel() |
||
28 | |||
29 | // Arrange |
||
30 | config := defaultRequestConfig() |
||
31 | timestamp := time.Now().Add(1 * time.Hour) |
||
32 | |||
33 | // Act |
||
34 | WithRequestTimestamp(timestamp).apply(config) |
||
35 | |||
36 | // Assert |
||
37 | assert.Equal(t, timestamp, config.timestamp) |
||
38 | } |
||
39 |