getsubsomeinfologic_test.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. package logic
  2. import (
  3. "context"
  4. "github.com/zeromicro/go-zero/core/logx"
  5. "jyBXSubscribe/rpc/internal/svc"
  6. "jyBXSubscribe/rpc/type/bxsubscribe"
  7. "reflect"
  8. "testing"
  9. )
  10. func TestGetSubSomeInfoLogic_GetSubSomeInfo(t *testing.T) {
  11. type fields struct {
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. Logger logx.Logger
  15. }
  16. type args struct {
  17. in *bxsubscribe.SomeInfoReq
  18. }
  19. tests := []struct {
  20. name string
  21. fields fields
  22. args args
  23. want *bxsubscribe.SomeInfoResp
  24. wantErr bool
  25. }{
  26. // TODO: Add test cases.
  27. {
  28. name: "用户订阅信息查询",
  29. args: args{in: &bxsubscribe.SomeInfoReq{
  30. AppId: "10000",
  31. UserId: "5e8eb60ae138234b4f91aacf",
  32. UserType: "mType",
  33. NewUserId: "11111",
  34. },
  35. },
  36. },
  37. }
  38. for _, tt := range tests {
  39. t.Run(tt.name, func(t *testing.T) {
  40. l := &GetSubSomeInfoLogic{
  41. ctx: tt.fields.ctx,
  42. svcCtx: tt.fields.svcCtx,
  43. Logger: tt.fields.Logger,
  44. }
  45. got, err := l.GetSubSomeInfo(tt.args.in)
  46. if (err != nil) != tt.wantErr {
  47. t.Errorf("GetSubSomeInfo() error = %v, wantErr %v", err, tt.wantErr)
  48. return
  49. }
  50. if !reflect.DeepEqual(got, tt.want) {
  51. t.Errorf("GetSubSomeInfo() got = %v, want %v", got, tt.want)
  52. }
  53. })
  54. }
  55. }
  56. func TestNewGetSubListLogic(t *testing.T) {
  57. type args struct {
  58. ctx context.Context
  59. svcCtx *svc.ServiceContext
  60. }
  61. tests := []struct {
  62. name string
  63. args args
  64. want *GetSubListLogic
  65. }{
  66. // TODO: Add test cases.
  67. }
  68. for _, tt := range tests {
  69. t.Run(tt.name, func(t *testing.T) {
  70. if got := NewGetSubListLogic(tt.args.ctx, tt.args.svcCtx); !reflect.DeepEqual(got, tt.want) {
  71. t.Errorf("NewGetSubListLogic() = %v, want %v", got, tt.want)
  72. }
  73. })
  74. }
  75. }
  76. func TestNewGetSubSomeInfoLogic(t *testing.T) {
  77. type args struct {
  78. ctx context.Context
  79. svcCtx *svc.ServiceContext
  80. }
  81. tests := []struct {
  82. name string
  83. args args
  84. want *GetSubSomeInfoLogic
  85. }{
  86. // TODO: Add test cases.
  87. }
  88. for _, tt := range tests {
  89. t.Run(tt.name, func(t *testing.T) {
  90. if got := NewGetSubSomeInfoLogic(tt.args.ctx, tt.args.svcCtx); !reflect.DeepEqual(got, tt.want) {
  91. t.Errorf("NewGetSubSomeInfoLogic() = %v, want %v", got, tt.want)
  92. }
  93. })
  94. }
  95. }