notify_test.go 877 B

123456789101112131415161718192021222324252627282930313233343536
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaonotifyURI(t *testing.T) {
  8. convey.Convey("notifyURI", t, func(convCtx convey.C) {
  9. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  10. p1 := testDao.notifyURI()
  11. convCtx.Convey("Then p1 should not be nil.", func(convCtx convey.C) {
  12. convCtx.So(p1, convey.ShouldNotBeNil)
  13. })
  14. })
  15. })
  16. }
  17. func TestDaoSendNotify(t *testing.T) {
  18. convey.Convey("SendNotify", t, func(convCtx convey.C) {
  19. var (
  20. c = context.Background()
  21. title = ""
  22. content = ""
  23. mids = []int64{1}
  24. )
  25. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  26. err := testDao.SendNotify(c, title, content, mids)
  27. convCtx.Convey("Then err should be nil.", func(convCtx convey.C) {
  28. convCtx.So(err, convey.ShouldBeNil)
  29. })
  30. })
  31. })
  32. }