dao.cache_test.go 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoOrderUser(t *testing.T) {
  8. convey.Convey("OrderUser", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. id = "56272730181109202542"
  12. )
  13. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  14. res, err := d.OrderUser(c, id)
  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 TestDaoAsset(t *testing.T) {
  23. convey.Convey("Asset", t, func(ctx convey.C) {
  24. var (
  25. c = context.Background()
  26. id = int64(10110745)
  27. otype = "archive"
  28. currency = "bp"
  29. )
  30. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  31. err := d.DelCacheAsset(c, id, otype, currency)
  32. convey.So(err, convey.ShouldBeNil)
  33. res, err := d.Asset(c, id, otype, currency)
  34. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  35. ctx.So(err, convey.ShouldBeNil)
  36. ctx.So(res, convey.ShouldNotBeNil)
  37. })
  38. })
  39. })
  40. }
  41. // func TestDaoAggrIncomeUser(t *testing.T) {
  42. // convey.Convey("AggrIncomeUser", t, func(ctx convey.C) {
  43. // var (
  44. // c = context.Background()
  45. // mid = int64(46333)
  46. // cur = "bp"
  47. // )
  48. // ctx.Convey("When everything goes positive", func(ctx convey.C) {
  49. // res, err := d.AggrIncomeUser(c, mid, cur)
  50. // ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  51. // ctx.So(err, convey.ShouldBeNil)
  52. // ctx.So(res, convey.ShouldNotBeNil)
  53. // })
  54. // })
  55. // })
  56. // }
  57. // func TestDaoAggrIncomeUserMonthly(t *testing.T) {
  58. // convey.Convey("AggrIncomeUserMonthly", t, func(ctx convey.C) {
  59. // var (
  60. // c = context.Background()
  61. // id = int64(46333)
  62. // ver = int64(201810)
  63. // cur = "bp"
  64. // )
  65. // ctx.Convey("When everything goes positive", func(ctx convey.C) {
  66. // res, err := d.AggrIncomeUseAssetList(c, id, cur, ver)
  67. // ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  68. // ctx.So(err, convey.ShouldBeNil)
  69. // ctx.So(res, convey.ShouldNotBeNil)
  70. // })
  71. // })
  72. // })
  73. // }