search_test.go 546 B

12345678910111213141516171819202122232425
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoSearchVideo(t *testing.T) {
  8. var (
  9. c = context.Background()
  10. pn = int(1)
  11. ps = int(10)
  12. query = "aaaaa"
  13. )
  14. convey.Convey("SearchVideo", t, func(ctx convey.C) {
  15. res, count, err := d.SearchVideo(c, pn, ps, query)
  16. ctx.Convey("Then err should be nil.res,count should not be nil.", func(ctx convey.C) {
  17. ctx.So(err, convey.ShouldBeNil)
  18. ctx.So(count, convey.ShouldNotBeNil)
  19. ctx.So(res, convey.ShouldNotBeNil)
  20. })
  21. })
  22. }