stat_test.go 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaoStatArchiveStat(t *testing.T) {
  9. convey.Convey("StatArchiveStat", t, func(convCtx convey.C) {
  10. var (
  11. c = context.Background()
  12. business = int(0)
  13. typeIDS = []int64{}
  14. uids = []int64{}
  15. statTypes = []int64{}
  16. statDate = time.Now()
  17. )
  18. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  19. d.StatArchiveStat(c, business, typeIDS, uids, statTypes, statDate)
  20. convCtx.Convey("Then err should be nil.statNodes should not be nil.", func(convCtx convey.C) {
  21. })
  22. })
  23. })
  24. }
  25. func TestDaoQueryArchiveCargo(t *testing.T) {
  26. convey.Convey("QueryArchiveCargo", t, func(convCtx convey.C) {
  27. var (
  28. c = context.Background()
  29. statTime = time.Now()
  30. uids = []int64{}
  31. )
  32. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  33. d.QueryArchiveCargo(c, statTime, uids)
  34. convCtx.Convey("Then err should be nil.items should not be nil.", func(convCtx convey.C) {
  35. })
  36. })
  37. })
  38. }
  39. func TestDaoGetUIDByNames(t *testing.T) {
  40. convey.Convey("GetUIDByNames", t, func(convCtx convey.C) {
  41. var (
  42. c = context.Background()
  43. unames = ""
  44. )
  45. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  46. d.GetUIDByNames(c, unames)
  47. convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
  48. })
  49. })
  50. })
  51. }
  52. func TestDaoGetUNamesByUids(t *testing.T) {
  53. convey.Convey("GetUNamesByUids", t, func(convCtx convey.C) {
  54. var (
  55. c = context.Background()
  56. uids = []int64{}
  57. )
  58. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  59. d.GetUNamesByUids(c, uids)
  60. convCtx.Convey("Then err should be nil.res should not be nil.", func(convCtx convey.C) {
  61. })
  62. })
  63. })
  64. }
  65. func TestDaoStatArchiveStatStream(t *testing.T) {
  66. convey.Convey("StatArchiveStatStream", t, func(convCtx convey.C) {
  67. var (
  68. c = context.Background()
  69. business = int(0)
  70. typeIDS = []int64{}
  71. uids = []int64{}
  72. statTypes = []int64{}
  73. statDate = time.Now()
  74. )
  75. convCtx.Convey("When everything goes positive", func(convCtx convey.C) {
  76. d.StatArchiveStatStream(c, business, typeIDS, uids, statTypes, statDate)
  77. convCtx.Convey("Then err should be nil.statNodes should not be nil.", func(convCtx convey.C) {
  78. })
  79. })
  80. })
  81. }