oper_test.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoAddVideoOper(t *testing.T) {
  8. var (
  9. c = context.TODO()
  10. aid = int64(1)
  11. adminID = int64(421)
  12. vid = int64(1)
  13. attribute = int32(0)
  14. status = int16(0)
  15. lastID = int64(0)
  16. content = "测试"
  17. remark = "测试"
  18. )
  19. convey.Convey("AddVideoOper", t, func(ctx convey.C) {
  20. id, err := d.AddVideoOper(c, aid, adminID, vid, attribute, status, lastID, content, remark)
  21. ctx.Convey("Then err should be nil.id should not be nil.", func(ctx convey.C) {
  22. ctx.So(err, convey.ShouldBeNil)
  23. ctx.So(id, convey.ShouldNotBeNil)
  24. })
  25. })
  26. }
  27. func TestDaoVideoOpers(t *testing.T) {
  28. var (
  29. c = context.TODO()
  30. vid = int64(1)
  31. )
  32. convey.Convey("VideoOpers", t, func(ctx convey.C) {
  33. op, uids, err := d.VideoOpers(c, vid)
  34. ctx.Convey("Then err should be nil.op,uids should not be nil.", func(ctx convey.C) {
  35. ctx.So(err, convey.ShouldBeNil)
  36. ctx.So(uids, convey.ShouldNotBeNil)
  37. ctx.So(op, convey.ShouldNotBeNil)
  38. })
  39. })
  40. }