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
package test
import (
"crypto/ecdsa"
"example.com/m/conf"
"example.com/m/utils"
"math/big"
"reflect"
"testing"
)
func TestGenerateRandomNumber(t *testing.T) {
type args struct {
privateKey *ecdsa.PrivateKey
length int64
}
tests := []struct {
name string
args args
want *big.Int
}{
// TODO: Add test cases.
{
"randomPrvTest",
args{
privateKey: conf.GetConfig().SignPrivateKey,
length: 2,
},
big.NewInt(1),
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := utils.GenerateRandomNumber(tt.args.privateKey, tt.args.length); !reflect.DeepEqual(got, tt.want) {
t.Errorf("GenerateRandomNumber() = %v, want %v", got, tt.want)
}
})
}
}