dao_test.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package shop
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/interface/main/app-interface/conf"
  6. "go-common/app/interface/main/app-interface/model/shop"
  7. httpx "go-common/library/net/http/blademaster"
  8. . "github.com/smartystreets/goconvey/convey"
  9. )
  10. func TestNew(t *testing.T) {
  11. type args struct {
  12. c *conf.Config
  13. }
  14. tests := []struct {
  15. name string
  16. args args
  17. wantD *Dao
  18. }{
  19. // TODO: Add test cases.
  20. }
  21. for _, tt := range tests {
  22. Convey(tt.name, t, func() {
  23. gotD := New(tt.args.c)
  24. So(gotD, ShouldResemble, tt.wantD)
  25. })
  26. }
  27. }
  28. func TestDao_Info(t *testing.T) {
  29. type fields struct {
  30. client *httpx.Client
  31. info string
  32. }
  33. type args struct {
  34. c context.Context
  35. mid int64
  36. mobiApp string
  37. device string
  38. build int
  39. }
  40. tests := []struct {
  41. name string
  42. fields fields
  43. args args
  44. wantInfo *shop.Info
  45. wantErr error
  46. }{
  47. // TODO: Add test cases.
  48. }
  49. for _, tt := range tests {
  50. Convey(tt.name, t, func() {
  51. d := &Dao{
  52. client: tt.fields.client,
  53. info: tt.fields.info,
  54. }
  55. gotInfo, err := d.Info(tt.args.c, tt.args.mid, tt.args.mobiApp, tt.args.device, tt.args.build)
  56. So(gotInfo, ShouldResemble, tt.wantInfo)
  57. So(err, ShouldEqual, tt.wantErr)
  58. })
  59. }
  60. }