message_test.go 492 B

12345678910111213141516171819202122232425
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestMessage(t *testing.T) {
  9. var (
  10. mid = int64(1)
  11. title = "test title"
  12. msg = "test msg"
  13. now = time.Now()
  14. c = context.Background()
  15. )
  16. Convey("test send a message", t, WithDao(func(d *Dao) {
  17. d.SendReplyDelMsg(c, mid, title, msg, now)
  18. So(msg, ShouldEqual, "test msg")
  19. d.SendReportAcceptMsg(c, mid, title, msg, now)
  20. So(title, ShouldEqual, "test title")
  21. }))
  22. }