123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321 |
- package dao
- import (
- "context"
- "go-common/app/interface/main/dm2/model"
- "testing"
- "github.com/smartystreets/goconvey/convey"
- )
- func TestDaosubtitleKey(t *testing.T) {
- convey.Convey("subtitleKey", t, func(ctx convey.C) {
- var (
- oid = int64(0)
- subtitleID = int64(0)
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- p1 := testDao.subtitleKey(oid, subtitleID)
- ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
- ctx.So(p1, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaosubtitleVideoKey(t *testing.T) {
- convey.Convey("subtitleVideoKey", t, func(ctx convey.C) {
- var (
- oid = int64(0)
- tp = int32(0)
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- p1 := testDao.subtitleVideoKey(oid, tp)
- ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
- ctx.So(p1, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaosubtitleDraftKey(t *testing.T) {
- convey.Convey("subtitleDraftKey", t, func(ctx convey.C) {
- var (
- oid = int64(0)
- tp = int32(0)
- mid = int64(0)
- lan = uint8(0)
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- p1 := testDao.subtitleDraftKey(oid, tp, mid, lan)
- ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
- ctx.So(p1, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaosubtitleSubjectKey(t *testing.T) {
- convey.Convey("subtitleSubjectKey", t, func(ctx convey.C) {
- var (
- aid = int64(0)
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- p1 := testDao.subtitleSubjectKey(aid)
- ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
- ctx.So(p1, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaosubtitleReportTagKey(t *testing.T) {
- convey.Convey("subtitleReportTagKey", t, func(ctx convey.C) {
- var (
- bid = int64(0)
- rid = int64(0)
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- p1 := testDao.subtitleReportTagKey(bid, rid)
- ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
- ctx.So(p1, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaoSetVideoSubtitleCache(t *testing.T) {
- convey.Convey("SetVideoSubtitleCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- oid = int64(0)
- tp = int32(0)
- res = &model.VideoSubtitleCache{}
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- err := testDao.SetVideoSubtitleCache(c, oid, tp, res)
- ctx.Convey("Then err should be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- })
- })
- })
- }
- func TestDaoVideoSubtitleCache(t *testing.T) {
- convey.Convey("VideoSubtitleCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- oid = int64(0)
- tp = int32(0)
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := testDao.VideoSubtitleCache(c, oid, tp)
- ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- ctx.So(res, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaoDelVideoSubtitleCache(t *testing.T) {
- convey.Convey("DelVideoSubtitleCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- oid = int64(0)
- tp = int32(0)
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- err := testDao.DelVideoSubtitleCache(c, oid, tp)
- ctx.Convey("Then err should be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- })
- })
- })
- }
- func TestDaoSubtitleDraftCache(t *testing.T) {
- convey.Convey("SubtitleDraftCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- oid = int64(0)
- tp = int32(0)
- mid = int64(0)
- lan = uint8(0)
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- testDao.SubtitleDraftCache(c, oid, tp, mid, lan)
- })
- })
- }
- func TestDaoSetSubtitleDraftCache(t *testing.T) {
- convey.Convey("SetSubtitleDraftCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- subtitle = &model.Subtitle{}
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- err := testDao.SetSubtitleDraftCache(c, subtitle)
- ctx.Convey("Then err should be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- })
- })
- })
- }
- func TestDaoDelSubtitleDraftCache(t *testing.T) {
- convey.Convey("DelSubtitleDraftCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- oid = int64(0)
- tp = int32(0)
- mid = int64(0)
- lan = uint8(0)
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- err := testDao.DelSubtitleDraftCache(c, oid, tp, mid, lan)
- ctx.Convey("Then err should be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- })
- })
- })
- }
- func TestDaoSubtitlesCache(t *testing.T) {
- convey.Convey("SubtitlesCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- oid = int64(0)
- subtitleIds = []int64{}
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, missed, err := testDao.SubtitlesCache(c, oid, subtitleIds)
- ctx.Convey("Then err should be nil.res,missed should not be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- ctx.So(missed, convey.ShouldNotBeNil)
- ctx.So(res, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaoSubtitleCache(t *testing.T) {
- convey.Convey("SubtitleCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- oid = int64(0)
- subtitleID = int64(0)
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- testDao.SubtitleCache(c, oid, subtitleID)
- })
- })
- }
- func TestDaoSetSubtitleCache(t *testing.T) {
- convey.Convey("SetSubtitleCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- subtitle = &model.Subtitle{}
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- err := testDao.SetSubtitleCache(c, subtitle)
- ctx.Convey("Then err should be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- })
- })
- })
- }
- func TestDaoDelSubtitleCache(t *testing.T) {
- convey.Convey("DelSubtitleCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- oid = int64(0)
- subtitleID = int64(0)
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- err := testDao.DelSubtitleCache(c, oid, subtitleID)
- ctx.Convey("Then err should be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- })
- })
- })
- }
- func TestDaoSetSubtitleSubjectCache(t *testing.T) {
- convey.Convey("SetSubtitleSubjectCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- subtitleSubject = &model.SubtitleSubject{}
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- err := testDao.SetSubtitleSubjectCache(c, subtitleSubject)
- ctx.Convey("Then err should be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- })
- })
- })
- }
- func TestDaoSubtitleSubjectCache(t *testing.T) {
- convey.Convey("SubtitleSubjectCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- aid = int64(0)
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- subtitleSubject, err := testDao.SubtitleSubjectCache(c, aid)
- ctx.Convey("Then err should be nil.subtitleSubject should not be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- ctx.So(subtitleSubject, convey.ShouldNotBeNil)
- })
- })
- })
- }
- func TestDaoDelSubtitleSubjectCache(t *testing.T) {
- convey.Convey("DelSubtitleSubjectCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- aid = int64(0)
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- err := testDao.DelSubtitleSubjectCache(c, aid)
- ctx.Convey("Then err should be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- })
- })
- })
- }
- func TestDaoSubtitleWorlFlowTagCache(t *testing.T) {
- convey.Convey("SubtitleWorlFlowTagCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- bid = int64(0)
- rid = int64(0)
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- testDao.SubtitleWorlFlowTagCache(c, bid, rid)
- })
- })
- }
- func TestDaoSetSubtitleWorlFlowTagCache(t *testing.T) {
- convey.Convey("SetSubtitleWorlFlowTagCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- bid = int64(0)
- rid = int64(0)
- data = []*model.WorkFlowTag{}
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- err := testDao.SetSubtitleWorlFlowTagCache(c, bid, rid, data)
- ctx.Convey("Then err should be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- })
- })
- })
- }
|