databus_test.go 769 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoPubView(t *testing.T) {
  8. var (
  9. c = context.Background()
  10. pid = int64(1)
  11. aid = int64(13825646)
  12. view = int64(1000)
  13. )
  14. convey.Convey("PubView", t, func(ctx convey.C) {
  15. err := d.PubView(c, pid, aid, view)
  16. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  17. ctx.So(err, convey.ShouldBeNil)
  18. })
  19. })
  20. }
  21. func TestDaoPubShare(t *testing.T) {
  22. var (
  23. c = context.Background()
  24. pid = int64(1)
  25. aid = int64(13825646)
  26. share = int64(50)
  27. )
  28. convey.Convey("PubShare", t, func(ctx convey.C) {
  29. err := d.PubShare(c, pid, aid, share)
  30. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  31. ctx.So(err, convey.ShouldBeNil)
  32. })
  33. })
  34. }