mc_subtitle_test.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 goes 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 goes 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 goes 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 TestDaoDelVideoSubtitleCache(t *testing.T) {
  52. convey.Convey("DelVideoSubtitleCache", t, func(ctx convey.C) {
  53. var (
  54. c = context.Background()
  55. oid = int64(0)
  56. tp = int32(0)
  57. )
  58. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  59. testDao.DelVideoSubtitleCache(c, oid, tp)
  60. })
  61. })
  62. }
  63. func TestDaoDelSubtitleDraftCache(t *testing.T) {
  64. convey.Convey("DelSubtitleDraftCache", t, func(ctx convey.C) {
  65. var (
  66. c = context.Background()
  67. oid = int64(0)
  68. tp = int32(0)
  69. mid = int64(0)
  70. lan = uint8(0)
  71. )
  72. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  73. testDao.DelSubtitleDraftCache(c, oid, tp, mid, lan)
  74. })
  75. })
  76. }
  77. func TestDaoDelSubtitleCache(t *testing.T) {
  78. convey.Convey("DelSubtitleCache", t, func(ctx convey.C) {
  79. var (
  80. c = context.Background()
  81. oid = int64(0)
  82. subtitleID = int64(0)
  83. )
  84. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  85. testDao.DelSubtitleCache(c, oid, subtitleID)
  86. })
  87. })
  88. }