databus_test.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoPubBigData(t *testing.T) {
  8. var (
  9. c = context.TODO()
  10. aid = int64(1)
  11. msg = interface{}("PubBigData")
  12. )
  13. convey.Convey("PubBigData", t, func(ctx convey.C) {
  14. err := d.PubBigData(c, aid, msg)
  15. ctx.Convey("Error should be nil", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. })
  18. })
  19. }
  20. func TestDaoPubCoinJob(t *testing.T) {
  21. var (
  22. c = context.TODO()
  23. aid = int64(1)
  24. msg = interface{}("PubCoinJob")
  25. )
  26. convey.Convey("PubCoinJob", t, func(ctx convey.C) {
  27. err := d.PubCoinJob(c, aid, msg)
  28. ctx.Convey("Error should be nil", func(ctx convey.C) {
  29. ctx.So(err, convey.ShouldBeNil)
  30. })
  31. })
  32. }
  33. func TestDaoPubStat(t *testing.T) {
  34. var (
  35. c = context.TODO()
  36. aid = int64(1)
  37. tp = int64(2)
  38. count = int64(10)
  39. )
  40. convey.Convey("PubStat", t, func(ctx convey.C) {
  41. err := d.PubStat(c, aid, tp, count)
  42. ctx.Convey("Error should be nil", func(ctx convey.C) {
  43. ctx.So(err, convey.ShouldBeNil)
  44. })
  45. })
  46. }