withdraw_test.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. package income
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func Test_UpWithdraw(t *testing.T) {
  8. Convey("UpWithdraw", t, WithService(func(s *Service) {
  9. var (
  10. mids = []int64{int64(1101)}
  11. isDeleted = 1
  12. from, limit = 0, 1000
  13. )
  14. res, _, err := s.UpWithdraw(context.Background(), mids, isDeleted, from, limit)
  15. So(err, ShouldBeNil)
  16. So(len(res), ShouldBeGreaterThan, 0)
  17. }))
  18. }
  19. func Test_UpWithdrawExport(t *testing.T) {
  20. Convey("UpWithdrawExport", t, WithService(func(s *Service) {
  21. var (
  22. mids = []int64{int64(1101)}
  23. isDeleted = 1
  24. from, limit = 0, 1000
  25. )
  26. res, err := s.UpWithdrawExport(context.Background(), mids, isDeleted, from, limit)
  27. So(err, ShouldBeNil)
  28. So(len(res), ShouldBeGreaterThan, 0)
  29. }))
  30. }
  31. func Test_GetUpWithdraw(t *testing.T) {
  32. Convey("GetUpWithdraw", t, WithService(func(s *Service) {
  33. var (
  34. query = ""
  35. )
  36. res, err := s.GetUpWithdraw(context.Background(), query)
  37. So(err, ShouldBeNil)
  38. So(len(res), ShouldBeGreaterThan, 0)
  39. }))
  40. }
  41. func Test_ListUpWithdraw(t *testing.T) {
  42. Convey("ListUpWithdraw", t, WithService(func(s *Service) {
  43. var (
  44. id int64
  45. query = ""
  46. limit = 500
  47. )
  48. res, err := s.ListUpWithdraw(context.Background(), id, query, limit)
  49. So(err, ShouldBeNil)
  50. So(len(res), ShouldBeGreaterThan, 0)
  51. }))
  52. }
  53. func Test_UpWithdrawStatis(t *testing.T) {
  54. Convey("UpWithdrawStatis", t, WithService(func(s *Service) {
  55. var (
  56. isDeleted = 0
  57. )
  58. _, err := s.UpWithdrawStatis(context.Background(), 1522512000, 1533052800, isDeleted)
  59. So(err, ShouldBeNil)
  60. }))
  61. }
  62. func Test_UpWithdrawDetail(t *testing.T) {
  63. Convey("UpWithdrawDetail", t, WithService(func(s *Service) {
  64. var (
  65. mid int64 = 50
  66. )
  67. res, err := s.UpWithdrawDetail(context.Background(), mid)
  68. So(err, ShouldBeNil)
  69. So(len(res), ShouldBeGreaterThan, 0)
  70. }))
  71. }
  72. func Test_UpWithdrawDetailExport(t *testing.T) {
  73. Convey("UpWithdrawDetailExport", t, WithService(func(s *Service) {
  74. var (
  75. mid int64 = 50
  76. )
  77. res, err := s.UpWithdrawDetailExport(context.Background(), mid)
  78. So(err, ShouldBeNil)
  79. So(len(res), ShouldBeGreaterThan, 0)
  80. }))
  81. }