chall_test.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoChallByIDs(t *testing.T) {
  8. convey.Convey("ChallByIDs", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. cids = []int64{1}
  12. )
  13. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  14. res, err := d.ChallByIDs(c, cids)
  15. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. ctx.So(res, convey.ShouldNotBeNil)
  18. })
  19. })
  20. })
  21. }
  22. func TestDaoUpDispatchStateByIDs(t *testing.T) {
  23. convey.Convey("UpDispatchStateByIDs", t, func(ctx convey.C) {
  24. var (
  25. c = context.Background()
  26. cids = []int64{}
  27. dispatchState = int64(0)
  28. )
  29. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  30. err := d.UpDispatchStateByIDs(c, cids, dispatchState)
  31. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  32. ctx.So(err, convey.ShouldBeNil)
  33. })
  34. })
  35. })
  36. }
  37. func TestDaoUpDispatchStateAdminIDByIds(t *testing.T) {
  38. convey.Convey("UpDispatchStateAdminIDByIds", t, func(ctx convey.C) {
  39. var (
  40. c = context.Background()
  41. cids = []int64{}
  42. dispatchState = int64(0)
  43. assignAdminid = int64(0)
  44. )
  45. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  46. err := d.UpDispatchStateAdminIDByIds(c, cids, dispatchState, assignAdminid)
  47. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  48. ctx.So(err, convey.ShouldBeNil)
  49. })
  50. })
  51. })
  52. }