email_test.go 917 B

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