wechat_test.go 608 B

123456789101112131415161718192021222324252627
  1. package dao
  2. import (
  3. "testing"
  4. "github.com/smartystreets/goconvey/convey"
  5. )
  6. func TestDaoSendWechat(t *testing.T) {
  7. msg := "push strategy test wechat message"
  8. convey.Convey("SendWechat", t, func(ctx convey.C) {
  9. err := d.SendWechat(msg)
  10. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  11. ctx.So(err, convey.ShouldBeNil)
  12. })
  13. })
  14. }
  15. func TestDaosign(t *testing.T) {
  16. params := map[string]string{"a": "b"}
  17. convey.Convey("sign", t, func(ctx convey.C) {
  18. p1 := d.sign(params)
  19. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  20. ctx.So(p1, convey.ShouldNotBeEmpty)
  21. })
  22. })
  23. }