card_test.go 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. package card
  2. import (
  3. "context"
  4. "github.com/smartystreets/goconvey/convey"
  5. "testing"
  6. )
  7. func TestCountUpCard(t *testing.T) {
  8. var c = context.Background()
  9. convey.Convey("CountUpCard", t, func(ctx convey.C) {
  10. total, err := d.CountUpCard(c)
  11. ctx.Convey("Then err should be nil.total should not be nil", func(ctx convey.C) {
  12. ctx.So(err, convey.ShouldBeNil)
  13. ctx.So(total, convey.ShouldNotBeNil)
  14. })
  15. })
  16. }
  17. func TestPageListUpInfo(t *testing.T) {
  18. var (
  19. c = context.Background()
  20. offset = uint(1)
  21. size = uint(1)
  22. )
  23. convey.Convey("ListUpInfo", t, func(ctx convey.C) {
  24. infos, err := d.ListUpInfo(c, offset, size)
  25. ctx.Convey("Then err should be nil.infos should not be nil", func(ctx convey.C) {
  26. ctx.So(err, convey.ShouldBeNil)
  27. ctx.So(infos, convey.ShouldNotBeNil)
  28. })
  29. })
  30. }
  31. func TestListUpMID(t *testing.T) {
  32. var c = context.Background()
  33. convey.Convey("ListUpMID", t, func(ctx convey.C) {
  34. mids, err := d.ListUpMID(c)
  35. ctx.Convey("Then err should be nil.mids should not be nil", func(ctx convey.C) {
  36. ctx.So(err, convey.ShouldBeNil)
  37. ctx.So(mids, convey.ShouldNotBeNil)
  38. })
  39. })
  40. }
  41. func TestGetUpInfo(t *testing.T) {
  42. var (
  43. c = context.Background()
  44. mid = int64(1532165)
  45. )
  46. convey.Convey("GetUpInfo", t, func(ctx convey.C) {
  47. upInfo, err := d.GetUpInfo(c, mid)
  48. ctx.Convey("Then err should be nil.upInfo should not be nil", func(ctx convey.C) {
  49. ctx.So(err, convey.ShouldBeNil)
  50. ctx.So(upInfo, convey.ShouldNotBeNil)
  51. })
  52. })
  53. }
  54. func TestListUpAccount(t *testing.T) {
  55. var (
  56. c = context.Background()
  57. mid = int64(1532165)
  58. )
  59. convey.Convey("ListUpAccount", t, func(ctx convey.C) {
  60. accounts, err := d.ListUpAccount(c, mid)
  61. ctx.Convey("Then err should be nil.accounts should not be nil", func(ctx convey.C) {
  62. ctx.So(err, convey.ShouldBeNil)
  63. ctx.So(accounts, convey.ShouldNotBeNil)
  64. })
  65. })
  66. }
  67. func TestListUpImage(t *testing.T) {
  68. var (
  69. c = context.Background()
  70. mid = int64(1532165)
  71. )
  72. convey.Convey("ListUpImage", t, func(ctx convey.C) {
  73. images, err := d.ListUpImage(c, mid)
  74. ctx.Convey("Then err should be nil.images should not be nil", func(ctx convey.C) {
  75. ctx.So(err, convey.ShouldBeNil)
  76. ctx.So(images, convey.ShouldNotBeNil)
  77. })
  78. })
  79. }
  80. func TestListAVID(t *testing.T) {
  81. var (
  82. c = context.Background()
  83. mid = int64(1532165)
  84. )
  85. convey.Convey("ListAVID", t, func(ctx convey.C) {
  86. avids, err := d.ListAVID(c, mid)
  87. ctx.Convey("Then err should be nil.avids should not be nil", func(ctx convey.C) {
  88. ctx.So(err, convey.ShouldBeNil)
  89. ctx.So(avids, convey.ShouldNotBeNil)
  90. })
  91. })
  92. }
  93. func TestMidUpInfoMap(t *testing.T) {
  94. var (
  95. c = context.Background()
  96. mids = []int64{1532165}
  97. )
  98. convey.Convey("MidUpInfoMap", t, func(ctx convey.C) {
  99. res, err := d.MidUpInfoMap(c, mids)
  100. ctx.Convey("Then err should be nil.res should not be nil", func(ctx convey.C) {
  101. ctx.So(err, convey.ShouldBeNil)
  102. ctx.So(res, convey.ShouldNotBeNil)
  103. })
  104. })
  105. }
  106. func TestMidAccountsMap(t *testing.T) {
  107. var (
  108. c = context.Background()
  109. mids = []int64{1532165}
  110. )
  111. convey.Convey("MidAccountsMap", t, func(ctx convey.C) {
  112. res, err := d.MidAccountsMap(c, mids)
  113. ctx.Convey("Then err should be nil.res should not be nil", func(ctx convey.C) {
  114. ctx.So(err, convey.ShouldBeNil)
  115. ctx.So(res, convey.ShouldNotBeNil)
  116. })
  117. })
  118. }
  119. func TestMidImagesMap(t *testing.T) {
  120. var (
  121. c = context.Background()
  122. mids = []int64{1532165}
  123. )
  124. convey.Convey("MidImagesMap", t, func(ctx convey.C) {
  125. res, err := d.MidImagesMap(c, mids)
  126. ctx.Convey("Then err should be nil.res should not be nil", func(ctx convey.C) {
  127. ctx.So(err, convey.ShouldBeNil)
  128. ctx.So(res, convey.ShouldNotBeNil)
  129. })
  130. })
  131. }
  132. func TestMidAvidsMap(t *testing.T) {
  133. var (
  134. c = context.Background()
  135. mids = []int64{1532165}
  136. )
  137. convey.Convey("MidAvidsMap", t, func(ctx convey.C) {
  138. res, err := d.MidAvidsMap(c, mids)
  139. ctx.Convey("Then err should be nil.res should not be nil", func(ctx convey.C) {
  140. ctx.So(err, convey.ShouldBeNil)
  141. ctx.So(res, convey.ShouldNotBeNil)
  142. })
  143. })
  144. }