message_test.go 757 B

12345678910111213141516171819202122232425262728293031323334
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/admin/main/workflow/model"
  6. "go-common/app/admin/main/workflow/model/param"
  7. "github.com/smartystreets/goconvey/convey"
  8. )
  9. func TestDaoSendMessage(t *testing.T) {
  10. convey.Convey("SendMessage", t, func(ctx convey.C) {
  11. var (
  12. c = context.Background()
  13. msg = &param.MessageParam{
  14. Type: "json",
  15. Source: 1,
  16. DataType: 4,
  17. MC: model.WkfNotifyMC,
  18. Title: "test title",
  19. Context: "test context",
  20. MidList: []int64{1},
  21. }
  22. )
  23. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  24. err := d.SendMessage(c, msg)
  25. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  26. ctx.So(err.Error(), convey.ShouldEqual, "-6")
  27. })
  28. })
  29. })
  30. }