push_test.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoPushDatas(t *testing.T) {
  8. convey.Convey("PushDatas", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. curtime = ""
  12. )
  13. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  14. _, err := d.PushDatas(c, curtime)
  15. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. })
  18. })
  19. })
  20. }
  21. func TestDaoUpdatePushData(t *testing.T) {
  22. convey.Convey("UpdatePushData", t, func(ctx convey.C) {
  23. var (
  24. c = context.Background()
  25. status = int8(0)
  26. progressStatus = int8(0)
  27. pushedCount = int32(0)
  28. errcode = int64(0)
  29. data = int64(0)
  30. id = int64(0)
  31. )
  32. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  33. err := d.UpdatePushData(c, status, progressStatus, pushedCount, errcode, data, id)
  34. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  35. ctx.So(err, convey.ShouldBeNil)
  36. })
  37. })
  38. })
  39. }