aes_test.go 377 B

12345678910111213141516171819
  1. package service
  2. import (
  3. "testing"
  4. "github.com/smartystreets/goconvey/convey"
  5. )
  6. func TestService_encrypt(t *testing.T) {
  7. once.Do(startService)
  8. convey.Convey("", t, func() {
  9. text := "123456"
  10. et, err := s.encrypt(text)
  11. convey.So(err, convey.ShouldBeNil)
  12. dt, err := s.decrypt(et)
  13. convey.So(err, convey.ShouldBeNil)
  14. convey.So(dt, convey.ShouldEqual, text)
  15. })
  16. }