You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
642 B
30 lines
642 B
package service |
|
|
|
import ( |
|
"fmt" |
|
"testing" |
|
|
|
. "github.com/smartystreets/goconvey/convey" |
|
) |
|
|
|
func TestService_Encrypt(t *testing.T) { |
|
Convey("Encrypt param ", t, func() { |
|
input := []byte("13122119298") |
|
res, err := Encrypt(input) |
|
ShouldBeNil(err) |
|
ShouldNotBeNil(res) |
|
fmt.Printf("(%+v) \n", res) |
|
}) |
|
|
|
} |
|
|
|
func TestService_Decrypt(t *testing.T) { |
|
Convey("Decrypt param ", t, func() { |
|
input := []byte{70, 251, 31, 100, 140, 98, 156, 101, 27, 21, 201, 100, 159, 107, 90, 147} |
|
fmt.Printf("input is (%+v) \n", input) |
|
res, err := Decrypt(input) |
|
ShouldBeNil(err) |
|
ShouldNotBeNil(res) |
|
fmt.Printf("(%+v) \n", string(res)) |
|
}) |
|
}
|
|
|