request_option_test.go   A
last analyzed

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 17
dl 0
loc 37
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A smobilpay.TestWithNonce 0 13 1
A smobilpay.TestWithTimestamp 0 13 1
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