video_test.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoGetVID(t *testing.T) {
  8. var (
  9. c = context.TODO()
  10. aid = int64(10098208)
  11. cid = int64(10108827)
  12. )
  13. convey.Convey("GetVID", t, func(ctx convey.C) {
  14. vid, err := d.GetVID(c, aid, cid)
  15. ctx.Convey("Then err should be nil.vid should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. ctx.So(vid, convey.ShouldNotBeNil)
  18. })
  19. })
  20. }
  21. func TestDaoVideo(t *testing.T) {
  22. var (
  23. c = context.TODO()
  24. aid = int64(10110750)
  25. cid = int64(10134516)
  26. )
  27. convey.Convey("Video", t, func(ctx convey.C) {
  28. _, err := d.Video(c, aid, cid)
  29. ctx.Convey("Then err should be nil.v should not be nil.", func(ctx convey.C) {
  30. ctx.So(err, convey.ShouldBeNil)
  31. })
  32. })
  33. }
  34. func TestDaoVideoAttribute(t *testing.T) {
  35. var (
  36. c = context.TODO()
  37. )
  38. convey.Convey("VideoAttribute", t, func(ctx convey.C) {
  39. _, err := d.VideoAttribute(c, 0)
  40. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  41. ctx.So(err, convey.ShouldBeNil)
  42. })
  43. })
  44. }
  45. func TestDaoArcVideoByCID(t *testing.T) {
  46. var (
  47. c = context.TODO()
  48. )
  49. convey.Convey("ArcVideoByCID", t, func(ctx convey.C) {
  50. _, err := d.ArcVideoByCID(c, 0)
  51. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  52. ctx.So(err, convey.ShouldBeNil)
  53. })
  54. })
  55. }
  56. func TestDaoNewVideoByID(t *testing.T) {
  57. var (
  58. c = context.TODO()
  59. )
  60. convey.Convey("NewVideoByID", t, func(ctx convey.C) {
  61. _, err := d.NewVideoByID(c, 0)
  62. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  63. ctx.So(err, convey.ShouldBeNil)
  64. })
  65. })
  66. }