123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- package archive
- import (
- "context"
- "go-common/app/job/main/videoup/model/archive"
- _ "github.com/go-sql-driver/mysql"
- . "github.com/smartystreets/goconvey/convey"
- "testing"
- )
- func Test_NewVideo(t *testing.T) {
- var (
- c = context.TODO()
- err error
- sub *archive.Video
- )
- Convey("NewVideo", t, WithDao(func(d *Dao) {
- sub, err = d.NewVideo(c, "2333")
- So(err, ShouldBeNil)
- So(sub, ShouldBeNil)
- }))
- }
- func Test_NewSumDuration(t *testing.T) {
- var (
- c = context.TODO()
- err error
- sub int64
- )
- Convey("NewVideo", t, WithDao(func(d *Dao) {
- sub, err = d.NewSumDuration(c, 2333)
- So(err, ShouldBeNil)
- So(sub, ShouldBeZeroValue)
- }))
- }
- func Test_NewVideoByAid(t *testing.T) {
- var (
- c = context.TODO()
- err error
- sub *archive.Video
- )
- Convey("NewVideoByAid", t, WithDao(func(d *Dao) {
- sub, err = d.NewVideoByAid(c, "filename", 2333)
- So(err, ShouldBeNil)
- So(sub, ShouldBeNil)
- }))
- }
- func Test_NewVideoCount(t *testing.T) {
- var (
- c = context.TODO()
- err error
- sub int
- )
- Convey("NewVideoCount", t, WithDao(func(d *Dao) {
- sub, err = d.NewVideoCount(c, 2333)
- So(err, ShouldBeNil)
- So(sub, ShouldBeZeroValue)
- }))
- }
- func Test_NewVideoCountCapable(t *testing.T) {
- var (
- c = context.TODO()
- err error
- sub int
- )
- Convey("NewVideoCountCapable", t, WithDao(func(d *Dao) {
- sub, err = d.NewVideoCountCapable(c, 2333)
- So(err, ShouldBeNil)
- So(sub, ShouldBeZeroValue)
- }))
- }
- // old TODO deprecated
- func Test_Video(t *testing.T) {
- var (
- c = context.TODO()
- err error
- sub *archive.Video
- )
- Convey("Video", t, WithDao(func(d *Dao) {
- sub, err = d.NewVideo(c, "2333")
- So(err, ShouldBeNil)
- So(sub, ShouldBeNil)
- }))
- }
- func Test_SumDuration(t *testing.T) {
- var (
- c = context.TODO()
- err error
- sub int64
- )
- Convey("Video", t, WithDao(func(d *Dao) {
- sub, err = d.SumDuration(c, 2333)
- So(err, ShouldBeNil)
- So(sub, ShouldBeZeroValue)
- }))
- }
- func Test_VideoByAid(t *testing.T) {
- var (
- c = context.TODO()
- err error
- sub *archive.Video
- )
- Convey("VideoByAid", t, WithDao(func(d *Dao) {
- sub, err = d.VideoByAid(c, "filename", 2333)
- So(err, ShouldBeNil)
- So(sub, ShouldBeNil)
- }))
- }
- func Test_VideoCount(t *testing.T) {
- var (
- c = context.TODO()
- err error
- )
- Convey("VideoCount", t, WithDao(func(d *Dao) {
- _, err = d.VideoCount(c, 2333)
- So(err, ShouldBeNil)
- }))
- }
- func Test_VideoCountCapable(t *testing.T) {
- var (
- c = context.TODO()
- err error
- sub int
- )
- Convey("VideoCountCapable", t, WithDao(func(d *Dao) {
- sub, err = d.VideoCountCapable(c, 2333)
- So(err, ShouldBeNil)
- So(sub, ShouldBeZeroValue)
- }))
- }
- func Test_Reason(t *testing.T) {
- var (
- c = context.TODO()
- err error
- sub string
- )
- Convey("Reason", t, WithDao(func(d *Dao) {
- sub, err = d.Reason(c, 2333)
- So(err, ShouldBeNil)
- So(sub, ShouldBeEmpty)
- }))
- }
|