go-common/app/job/main/passport/service/aes_test.go
2019-04-22 18:49:16 +08:00

20 lines
377 B
Go

package service
import (
"testing"
"github.com/smartystreets/goconvey/convey"
)
func TestService_encrypt(t *testing.T) {
once.Do(startService)
convey.Convey("", t, func() {
text := "123456"
et, err := s.encrypt(text)
convey.So(err, convey.ShouldBeNil)
dt, err := s.decrypt(et)
convey.So(err, convey.ShouldBeNil)
convey.So(dt, convey.ShouldEqual, text)
})
}