web_data_test.go 986 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package like
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestLikeWebDataCnt(t *testing.T) {
  8. convey.Convey("WebDataCnt", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. vid = int64(0)
  12. )
  13. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  14. _, err := d.WebDataCnt(c, vid)
  15. ctx.Convey("Then err should be nil.count should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. })
  18. })
  19. })
  20. }
  21. func TestLikeWebDataList(t *testing.T) {
  22. convey.Convey("WebDataList", t, func(ctx convey.C) {
  23. var (
  24. c = context.Background()
  25. vid = int64(36)
  26. offset = int(1)
  27. limit = int(10)
  28. )
  29. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  30. list, err := d.WebDataList(c, vid, offset, limit)
  31. ctx.Convey("Then err should be nil.list should not be nil.", func(ctx convey.C) {
  32. ctx.So(err, convey.ShouldBeNil)
  33. ctx.So(list, convey.ShouldNotBeNil)
  34. })
  35. })
  36. })
  37. }