mc_subtitle_test.go 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaosubtitleKey(t *testing.T) {
  8. convey.Convey("subtitleKey", t, func(ctx convey.C) {
  9. var (
  10. oid = int64(0)
  11. subtitleID = int64(0)
  12. )
  13. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  14. p1 := testDao.subtitleKey(oid, subtitleID)
  15. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  16. ctx.So(p1, convey.ShouldNotBeNil)
  17. })
  18. })
  19. })
  20. }
  21. func TestDaosubtitleVideoKey(t *testing.T) {
  22. convey.Convey("subtitleVideoKey", t, func(ctx convey.C) {
  23. var (
  24. oid = int64(0)
  25. tp = int32(0)
  26. )
  27. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  28. p1 := testDao.subtitleVideoKey(oid, tp)
  29. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  30. ctx.So(p1, convey.ShouldNotBeNil)
  31. })
  32. })
  33. })
  34. }
  35. func TestDaosubtitleDraftKey(t *testing.T) {
  36. convey.Convey("subtitleDraftKey", t, func(ctx convey.C) {
  37. var (
  38. oid = int64(0)
  39. tp = int32(0)
  40. mid = int64(0)
  41. lan = uint8(0)
  42. )
  43. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  44. p1 := testDao.subtitleDraftKey(oid, tp, mid, lan)
  45. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  46. ctx.So(p1, convey.ShouldNotBeNil)
  47. })
  48. })
  49. })
  50. }
  51. func TestDaosubtitleSubjectKey(t *testing.T) {
  52. convey.Convey("subtitleSubjectKey", t, func(ctx convey.C) {
  53. var (
  54. aid = int64(0)
  55. )
  56. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  57. p1 := testDao.subtitleSubjectKey(aid)
  58. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  59. ctx.So(p1, convey.ShouldNotBeNil)
  60. })
  61. })
  62. })
  63. }
  64. func TestDaoDelVideoSubtitleCache(t *testing.T) {
  65. convey.Convey("DelVideoSubtitleCache", t, func(ctx convey.C) {
  66. var (
  67. c = context.Background()
  68. oid = int64(0)
  69. tp = int32(0)
  70. )
  71. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  72. testDao.DelVideoSubtitleCache(c, oid, tp)
  73. })
  74. })
  75. }
  76. func TestDaoDelSubtitleDraftCache(t *testing.T) {
  77. convey.Convey("DelSubtitleDraftCache", t, func(ctx convey.C) {
  78. var (
  79. c = context.Background()
  80. oid = int64(0)
  81. tp = int32(0)
  82. mid = int64(0)
  83. lan = uint8(0)
  84. )
  85. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  86. testDao.DelSubtitleDraftCache(c, oid, tp, mid, lan)
  87. })
  88. })
  89. }
  90. func TestDaoDelSubtitleCache(t *testing.T) {
  91. convey.Convey("DelSubtitleCache", t, func(ctx convey.C) {
  92. var (
  93. c = context.Background()
  94. oid = int64(0)
  95. subtitleID = int64(0)
  96. )
  97. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  98. testDao.DelSubtitleCache(c, oid, subtitleID)
  99. })
  100. })
  101. }
  102. func TestDaoDelSubtitleSubjectCache(t *testing.T) {
  103. convey.Convey("DelSubtitleSubjectCache", t, func(ctx convey.C) {
  104. var (
  105. c = context.Background()
  106. aid = int64(0)
  107. )
  108. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  109. testDao.DelSubtitleSubjectCache(c, aid)
  110. })
  111. })
  112. }