send_test.go 959 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package message
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestMessageSend(t *testing.T) {
  9. convey.Convey("Send", t, func(ctx convey.C) {
  10. var (
  11. c = context.Background()
  12. mc = "1_14_2"
  13. title = "test"
  14. msg = "test"
  15. mids = []int64{253550886}
  16. ts = time.Now().Unix()
  17. )
  18. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  19. err := d.Send(c, mc, title, msg, mids, ts)
  20. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  21. ctx.So(err, convey.ShouldBeNil)
  22. })
  23. })
  24. })
  25. }
  26. func TestMessageNotifyTask(t *testing.T) {
  27. convey.Convey("NotifyTask", t, func(ctx convey.C) {
  28. var (
  29. c = context.Background()
  30. mids = []int64{2316310}
  31. )
  32. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  33. err := d.NotifyTask(c, mids)
  34. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  35. ctx.So(err, convey.ShouldNotBeNil)
  36. })
  37. })
  38. })
  39. }