pendant_test.go 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/admin/main/usersuit/model"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func Test_PendantInfoList(t *testing.T) {
  9. Convey("return sth", t, func() {
  10. arg := &model.ArgPendantGroupList{}
  11. res, pager, err := s.PendantInfoList(context.Background(), arg)
  12. So(err, ShouldBeNil)
  13. So(res, ShouldNotBeNil)
  14. So(pager, ShouldNotBeNil)
  15. })
  16. }
  17. func Test_PendantInfoID(t *testing.T) {
  18. Convey("return sth", t, func() {
  19. pi, err := s.PendantInfoID(context.Background(), 11, 22)
  20. So(err, ShouldBeNil)
  21. So(pi, ShouldNotBeNil)
  22. })
  23. }
  24. func Test_PendantGroupID(t *testing.T) {
  25. Convey("return sth", t, func() {
  26. pg, err := s.PendantGroupID(context.Background(), 11)
  27. So(err, ShouldBeNil)
  28. So(pg, ShouldNotBeNil)
  29. })
  30. }
  31. func Test_PendantGroupList(t *testing.T) {
  32. Convey("return sth", t, func() {
  33. arg := &model.ArgPendantGroupList{}
  34. pgs, pager, err := s.PendantGroupList(context.Background(), arg)
  35. So(err, ShouldBeNil)
  36. So(pgs, ShouldNotBeNil)
  37. So(pager, ShouldNotBeNil)
  38. })
  39. }
  40. func Test_PendantGroupAll(t *testing.T) {
  41. Convey("return sth", t, func() {
  42. pgs, err := s.PendantGroupAll(context.Background())
  43. So(err, ShouldBeNil)
  44. So(pgs, ShouldNotBeNil)
  45. })
  46. }
  47. func Test_PendantInfoAllOnSale(t *testing.T) {
  48. Convey("return sth", t, func() {
  49. pis, err := s.PendantInfoAllNoPage(context.Background())
  50. So(err, ShouldBeNil)
  51. So(pis, ShouldNotBeNil)
  52. })
  53. }
  54. func Test_AddPendantInfo(t *testing.T) {
  55. Convey("return sth", t, func() {
  56. arg := &model.ArgPendantInfo{
  57. PID: 111,
  58. GID: 22,
  59. Name: "222",
  60. Image: "sdada",
  61. ImageModel: "dasdada",
  62. Rank: 11,
  63. Status: 1,
  64. IntegralPrice: 22,
  65. }
  66. err := s.AddPendantInfo(context.Background(), arg)
  67. So(err, ShouldBeNil)
  68. })
  69. }
  70. func Test_UpPendantInfo(t *testing.T) {
  71. Convey("return sth", t, func() {
  72. arg := &model.ArgPendantInfo{
  73. PID: 111,
  74. GID: 22,
  75. Name: "222",
  76. Image: "sdada",
  77. ImageModel: "dasdada",
  78. Rank: 11,
  79. Status: 1,
  80. IntegralPrice: 22,
  81. }
  82. err := s.UpPendantInfo(context.Background(), arg)
  83. So(err, ShouldBeNil)
  84. })
  85. }
  86. func Test_UpPendantGroupStatus(t *testing.T) {
  87. Convey("return sth", t, func() {
  88. err := s.UpPendantGroupStatus(context.Background(), 1, 1)
  89. So(err, ShouldBeNil)
  90. })
  91. }
  92. func Test_UpPendantInfoStatus(t *testing.T) {
  93. Convey("return sth", t, func() {
  94. err := s.UpPendantInfoStatus(context.Background(), 1, 1)
  95. So(err, ShouldBeNil)
  96. })
  97. }
  98. func Test_AddPendantGroup(t *testing.T) {
  99. Convey("return sth", t, func() {
  100. arg := &model.ArgPendantGroup{
  101. GID: 1,
  102. Name: "2121",
  103. Rank: 11,
  104. Status: 1,
  105. }
  106. err := s.AddPendantGroup(context.Background(), arg)
  107. So(err, ShouldBeNil)
  108. })
  109. }
  110. func Test_UpPendantGroup(t *testing.T) {
  111. Convey("return sth", t, func() {
  112. arg := &model.ArgPendantGroup{
  113. GID: 1,
  114. Name: "2121",
  115. Rank: 11,
  116. Status: 1,
  117. }
  118. err := s.UpPendantGroup(context.Background(), arg)
  119. So(err, ShouldBeNil)
  120. })
  121. }
  122. func Test_PendantOrders(t *testing.T) {
  123. Convey("return sth", t, func() {
  124. arg := &model.ArgPendantOrder{}
  125. pos, pager, err := s.PendantOrders(context.Background(), arg)
  126. So(err, ShouldBeNil)
  127. So(pos, ShouldNotBeNil)
  128. So(pager, ShouldNotBeNil)
  129. })
  130. }