associate_ele_api_test.go 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/service/main/vip/model"
  6. "go-common/library/ecode"
  7. "github.com/smartystreets/goconvey/convey"
  8. )
  9. // func TestDaoEleOauthGenerateAccessToken(t *testing.T) {
  10. // convey.Convey("TestDaoEleOauthGenerateAccessToken", t, func(ctx convey.C) {
  11. // defer gock.OffAll()
  12. // httpMock("POST", _oauthGenerateAccessTokenURI).Reply(200).JSON(`{"code":0}`)
  13. // _, err := d.EleOauthGenerateAccessToken(context.Background(), &model.ArgEleAccessToken{
  14. // AuthCode: "abc"})
  15. // ctx.So(err, convey.ShouldBeNil)
  16. // })
  17. // }
  18. func TestDaoEleUnionReceivePrizes(t *testing.T) {
  19. convey.Convey("TestDaoEleUnionReceivePrizes", t, func(ctx convey.C) {
  20. _, err := d.EleUnionReceivePrizes(context.Background(), &model.ArgEleReceivePrizes{
  21. ElemeOpenID: "o8f999ad5d724b4a2ljbp7cm",
  22. BliOpenID: "e11303e8c26268a6cbdc2dc7fce55199",
  23. SourceID: "1",
  24. })
  25. ctx.So(err, convey.ShouldEqual, ecode.VipEleUnionReqErr)
  26. })
  27. }
  28. func TestDaoEleUnionUpdateOpenID(t *testing.T) {
  29. convey.Convey("TestDaoEleUnionUpdateOpenID", t, func(ctx convey.C) {
  30. _, err := d.EleUnionUpdateOpenID(context.Background(), &model.ArgEleUnionUpdateOpenID{
  31. ElemeOpenID: "oe1822de904ceed07bpvCUOU",
  32. BliOpenID: "bdca8b71e7a6726885d40a395bf9ccd1",
  33. })
  34. ctx.So(err, convey.ShouldEqual, ecode.VipEleUnionReqErr)
  35. })
  36. }
  37. // func TestDaoEleCanPurchase(t *testing.T) {
  38. // convey.Convey("TestDaoEleCanPurchase", t, func(ctx convey.C) {
  39. // _, err := d.EleCanPurchase(context.Background(), &model.ArgEleCanPurchase{
  40. // ElemeOpenID: "oe1822de904ceed07bpvCUOU",
  41. // BliOpenID: "8551e7e9827f759d7fe13bc41b8a7613",
  42. // UserIP: "10.23.167.25",
  43. // VipType: 2,
  44. // })
  45. // ctx.So(err, convey.ShouldBeNil)
  46. // })
  47. // }
  48. func TestDaoEleUnionMobile(t *testing.T) {
  49. convey.Convey("TestDaoEleUnionMobile", t, func(ctx convey.C) {
  50. _, err := d.EleUnionMobile(context.Background(), &model.ArgEleUnionMobile{
  51. ElemeOpenID: "o8f999ad5d724b4a2ljbp7cm",
  52. BliOpenID: "e11303e8c26268a6cbdc2dc7fce55199",
  53. })
  54. ctx.So(err, convey.ShouldEqual, ecode.VipEleUnionReqErr)
  55. })
  56. }
  57. // func TestDaoEleBindUnion(t *testing.T) {
  58. // convey.Convey("TestDaoEleBindUnion", t, func(ctx convey.C) {
  59. // res, err := d.EleBindUnion(context.Background(), &model.ArgEleBindUnion{
  60. // ElemeOpenID: "o8f999ad5d724b4a2ljbp7cm",
  61. // BliOpenID: "e11303e8c26268a6cbdc2dc7fce55199",
  62. // VipType: 2,
  63. // SourceID: "123456789",
  64. // UserIP: "121.46.231.66",
  65. // })
  66. // ctx.Convey("TestDaoEleBindUnion ", func(ctx convey.C) {
  67. // ctx.So(err, convey.ShouldBeNil)
  68. // ctx.So(res, convey.ShouldNotBeNil)
  69. // })
  70. // })
  71. // }
  72. func TestDaoEleRedPackages(t *testing.T) {
  73. convey.Convey("TestDaoEleRedPackages", t, func(ctx convey.C) {
  74. _, err := d.EleRedPackages(context.Background())
  75. ctx.Convey("TestDaoEleRedPackages ", func(ctx convey.C) {
  76. ctx.So(err, convey.ShouldEqual, ecode.VipEleUnionReqErr)
  77. })
  78. })
  79. }
  80. func TestDaoEleSpecailFoods(t *testing.T) {
  81. convey.Convey("TestDaoEleSpecailFoods", t, func(ctx convey.C) {
  82. _, err := d.EleSpecailFoods(context.Background())
  83. ctx.Convey("TestDaoEleSpecailFoods ", func(ctx convey.C) {
  84. ctx.So(err, convey.ShouldEqual, ecode.VipEleUnionReqErr)
  85. })
  86. })
  87. }