email_test.go 454 B

1234567891011121314151617181920212223
  1. package dao
  2. import (
  3. "math/rand"
  4. "strconv"
  5. "testing"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaoSendMail(t *testing.T) {
  9. var (
  10. body = strconv.Itoa(rand.Intn(100))
  11. subject = "邮件测试hyy"
  12. send = "2459593393@qq.com"
  13. )
  14. convey.Convey("SendMail", t, func(ctx convey.C) {
  15. err := d.SendMail(body, subject, send)
  16. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  17. ctx.So(err, convey.ShouldBeNil)
  18. })
  19. })
  20. }