task_history_test.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/admin/main/videoup-task/model"
  5. "testing"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaoAddTaskHis(t *testing.T) {
  9. convey.Convey("AddTaskHis", t, func(ctx convey.C) {
  10. var (
  11. c = context.Background()
  12. pool = int8(0)
  13. action = int8(0)
  14. taskID = int64(0)
  15. cid = int64(0)
  16. uid = int64(0)
  17. utime = int64(0)
  18. result = int16(0)
  19. reason = ""
  20. )
  21. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  22. rows, err := d.AddTaskHis(c, pool, action, taskID, cid, uid, utime, result, reason)
  23. ctx.Convey("Then err should be nil.rows should not be nil.", func(ctx convey.C) {
  24. ctx.So(err, convey.ShouldBeNil)
  25. ctx.So(rows, convey.ShouldNotBeNil)
  26. })
  27. })
  28. })
  29. }
  30. func TestDaoMulAddTaskHis(t *testing.T) {
  31. convey.Convey("MulAddTaskHis", t, func(ctx convey.C) {
  32. var (
  33. c = context.Background()
  34. tls = []*model.TaskForLog{}
  35. action = int8(0)
  36. uid = int64(0)
  37. )
  38. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  39. rows, err := d.MulAddTaskHis(c, tls, action, uid)
  40. ctx.Convey("Then err should be nil.rows should not be nil.", func(ctx convey.C) {
  41. ctx.So(err, convey.ShouldBeNil)
  42. ctx.So(rows, convey.ShouldNotBeNil)
  43. })
  44. })
  45. })
  46. }