email_test.go 873 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package dao
  2. import (
  3. "testing"
  4. "github.com/smartystreets/goconvey/convey"
  5. )
  6. func TestDaoSendMail(t *testing.T) {
  7. convey.Convey("SendMail", t, func(ctx convey.C) {
  8. var (
  9. body = ""
  10. subject = ""
  11. send = []string{}
  12. )
  13. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  14. err := d.SendMail(body, subject, send)
  15. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldNotBeNil)
  17. })
  18. })
  19. })
  20. }
  21. func TestDaoSendMailAttach(t *testing.T) {
  22. convey.Convey("SendMailAttach", t, func(ctx convey.C) {
  23. var (
  24. filename = ""
  25. subject = ""
  26. send = []string{}
  27. )
  28. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  29. err := d.SendMailAttach(filename, subject, send)
  30. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  31. ctx.So(err, convey.ShouldNotBeNil)
  32. })
  33. })
  34. })
  35. }