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.
 
 
 

19 lines
377 B

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)
})
}