task_review_test.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/admin/main/videoup-task/model"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaoListConfs(t *testing.T) {
  9. convey.Convey("ListConfs", t, func(ctx convey.C) {
  10. var (
  11. c = context.Background()
  12. )
  13. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  14. _, _, err := d.ListConfs(c, []int64{}, "", "", "", 0, 0)
  15. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. })
  18. })
  19. })
  20. }
  21. func TestDaoReviewConfs(t *testing.T) {
  22. convey.Convey("ReviewConfs", t, func(ctx convey.C) {
  23. var (
  24. c = context.Background()
  25. )
  26. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  27. _, err := d.ReviewConfs(c)
  28. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  29. ctx.So(err, convey.ShouldBeNil)
  30. })
  31. })
  32. })
  33. }
  34. func TestDaoUpReviewConf(t *testing.T) {
  35. convey.Convey("UpReviewConf", t, func(ctx convey.C) {
  36. var (
  37. c = context.Background()
  38. )
  39. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  40. _, err := d.UpReviewConf(c, &model.ReviewConf{})
  41. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  42. ctx.So(err, convey.ShouldBeNil)
  43. })
  44. })
  45. })
  46. }
  47. func TestDaoDelReviewConf(t *testing.T) {
  48. convey.Convey("DelReviewConf", t, func(ctx convey.C) {
  49. var (
  50. c = context.Background()
  51. )
  52. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  53. _, err := d.DelReviewConf(c, 0)
  54. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  55. ctx.So(err, convey.ShouldBeNil)
  56. })
  57. })
  58. })
  59. }
  60. func TestDaoReviewForm(t *testing.T) {
  61. convey.Convey("ReviewForm", t, func(ctx convey.C) {
  62. var (
  63. c = context.Background()
  64. )
  65. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  66. _, err := d.ReviewForm(c, 0)
  67. ctx.Convey("Then err should be nil.max should not be nil.", func(ctx convey.C) {
  68. ctx.So(err, convey.ShouldBeNil)
  69. })
  70. })
  71. })
  72. }