123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448 |
- package datadao
- import (
- "context"
- "go-common/app/interface/main/mcn/tool/datacenter"
- "testing"
- "time"
- "github.com/smartystreets/goconvey/convey"
- "go-common/app/interface/main/mcn/model/datamodel"
- )
- func TestDatadaocallDataAPI(t *testing.T) {
- convey.Convey("callDataAPI", t, func(ctx convey.C) {
- var (
- c = context.Background()
- api = APIMcnSummary
- query = &datacenter.Query{}
- res []*datamodel.DmConMcnArchiveD
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- err := d.callDataAPI(c, api, query, res)
- ctx.Convey("Then err should be nil.", func(ctx convey.C) {
- ctx.So(err, convey.ShouldBeNil)
- })
- })
- })
- }
- func TestDatadaoGetMcnSummary(t *testing.T) {
- convey.Convey("GetMcnSummary", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetMcnSummary(c, signID, date)
- 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 TestDatadaoGetMcnSummaryCache(t *testing.T) {
- convey.Convey("GetMcnSummaryCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetMcnSummaryCache(c, signID, date)
- 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 TestDatadaoGetIndexInc(t *testing.T) {
- convey.Convey("GetIndexInc", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- tp = ""
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetIndexInc(c, signID, date, 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 TestDatadaoGetIndexIncCache(t *testing.T) {
- convey.Convey("GetIndexIncCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- tp = ""
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetIndexIncCache(c, signID, date, 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 TestDatadaoGetIndexSource(t *testing.T) {
- convey.Convey("GetIndexSource", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- tp = ""
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetIndexSource(c, signID, date, 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 TestDatadaoGetIndexSourceCache(t *testing.T) {
- convey.Convey("GetIndexSourceCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- tp = ""
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetIndexSourceCache(c, signID, date, 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 TestDatadaoGetPlaySource(t *testing.T) {
- convey.Convey("GetPlaySource", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetPlaySource(c, signID, date)
- 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 TestDatadaoGetPlaySourceCache(t *testing.T) {
- convey.Convey("GetPlaySourceCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetPlaySourceCache(c, signID, date)
- 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 TestDatadaoGetMcnFans(t *testing.T) {
- convey.Convey("GetMcnFans", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetMcnFans(c, signID, date)
- 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 TestDatadaoGetMcnFansCache(t *testing.T) {
- convey.Convey("GetMcnFansCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetMcnFansCache(c, signID, date)
- 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 TestDatadaoGetMcnFansInc(t *testing.T) {
- convey.Convey("GetMcnFansInc", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetMcnFansInc(c, signID, date)
- 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 TestDatadaoGetMcnFansIncCache(t *testing.T) {
- convey.Convey("GetMcnFansIncCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetMcnFansIncCache(c, signID, date)
- 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 TestDatadaoGetMcnFansDec(t *testing.T) {
- convey.Convey("GetMcnFansDec", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetMcnFansDec(c, signID, date)
- 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 TestDatadaoGetMcnFansDecCache(t *testing.T) {
- convey.Convey("GetMcnFansDecCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetMcnFansDecCache(c, signID, date)
- 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 TestDatadaoGetMcnFansAttentionWay(t *testing.T) {
- convey.Convey("GetMcnFansAttentionWay", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetMcnFansAttentionWay(c, signID, date)
- 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 TestDatadaoGetMcnFansAttentionWayCache(t *testing.T) {
- convey.Convey("GetMcnFansAttentionWayCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetMcnFansAttentionWayCache(c, signID, date)
- 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 TestDatadaoGetFansBaseFansAttr(t *testing.T) {
- convey.Convey("GetFansBaseFansAttr", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- tp = ""
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetFansBaseFansAttr(c, signID, date, 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 TestDatadaoGetFansBaseFansAttrCache(t *testing.T) {
- convey.Convey("GetFansBaseFansAttrCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- tp = ""
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetFansBaseFansAttrCache(c, signID, date, 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 TestDatadaoGetFansArea(t *testing.T) {
- convey.Convey("GetFansArea", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- tp = ""
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetFansArea(c, signID, date, 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 TestDatadaoGetFansAreaCache(t *testing.T) {
- convey.Convey("GetFansAreaCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- tp = ""
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetFansAreaCache(c, signID, date, 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 TestDatadaoGetFansType(t *testing.T) {
- convey.Convey("GetFansType", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- tp = ""
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetFansType(c, signID, date, 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 TestDatadaoGetFansTypeCache(t *testing.T) {
- convey.Convey("GetFansTypeCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- tp = ""
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetFansTypeCache(c, signID, date, 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 TestDatadaoGetFansTag(t *testing.T) {
- convey.Convey("GetFansTag", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- tp = ""
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetFansTag(c, signID, date, 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 TestDatadaoGetFansTagCache(t *testing.T) {
- convey.Convey("GetFansTagCache", t, func(ctx convey.C) {
- var (
- c = context.Background()
- signID = int64(0)
- date = time.Now()
- tp = ""
- )
- ctx.Convey("When everything gose positive", func(ctx convey.C) {
- res, err := d.GetFansTagCache(c, signID, date, 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)
- })
- })
- })
- }
|