dao.cache_test.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package dao
  2. import (
  3. "context"
  4. "go-common/library/log"
  5. "testing"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaoVideoExtension(t *testing.T) {
  9. convey.Convey("VideoExtension", t, func(convCtx convey.C) {
  10. var (
  11. c = context.Background()
  12. keys = []int64{1}
  13. )
  14. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  15. res, err := d.VideoExtension(c, keys)
  16. log.V(1).Infow(c, "res", res)
  17. convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
  18. convCtx.So(err, convey.ShouldBeNil)
  19. convCtx.So(res, convey.ShouldNotBeNil)
  20. })
  21. })
  22. })
  23. }
  24. func TestDaoTopicInfo(t *testing.T) {
  25. convey.Convey("TopicInfo", t, func(convCtx convey.C) {
  26. var (
  27. c = context.Background()
  28. keys = []int64{1}
  29. )
  30. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  31. res, err := d.TopicInfo(c, keys)
  32. convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
  33. convCtx.So(err, convey.ShouldBeNil)
  34. convCtx.So(res, convey.ShouldNotBeNil)
  35. })
  36. })
  37. })
  38. }