http_title_test.go 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoNoticeTitle(t *testing.T) {
  8. convey.Convey("NoticeTitle", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. oid = int64(0)
  12. )
  13. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  14. title, link, err := _d.NoticeTitle(c, oid)
  15. ctx.Convey("Then err should be nil.title,link should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. ctx.So(link, convey.ShouldNotBeNil)
  18. ctx.So(title, convey.ShouldNotBeNil)
  19. })
  20. })
  21. })
  22. }
  23. func TestDaoBanTitle(t *testing.T) {
  24. convey.Convey("BanTitle", t, func(ctx convey.C) {
  25. var (
  26. c = context.Background()
  27. oid = int64(0)
  28. )
  29. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  30. title, link, err := _d.BanTitle(c, oid)
  31. ctx.Convey("Then err should be nil.title,link should not be nil.", func(ctx convey.C) {
  32. ctx.So(err, convey.ShouldBeNil)
  33. ctx.So(link, convey.ShouldNotBeNil)
  34. ctx.So(title, convey.ShouldNotBeNil)
  35. })
  36. })
  37. })
  38. }
  39. func TestDaoCreditTitle(t *testing.T) {
  40. convey.Convey("CreditTitle", t, func(ctx convey.C) {
  41. var (
  42. c = context.Background()
  43. oid = int64(0)
  44. )
  45. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  46. title, link, err := _d.CreditTitle(c, oid)
  47. ctx.Convey("Then err should be nil.title,link should not be nil.", func(ctx convey.C) {
  48. ctx.So(err, convey.ShouldBeNil)
  49. ctx.So(link, convey.ShouldNotBeNil)
  50. ctx.So(title, convey.ShouldNotBeNil)
  51. })
  52. })
  53. })
  54. }
  55. func TestDaoLiveVideoTitle(t *testing.T) {
  56. convey.Convey("LiveVideoTitle", t, func(ctx convey.C) {
  57. var (
  58. c = context.Background()
  59. oid = int64(0)
  60. )
  61. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  62. title, link, err := _d.LiveVideoTitle(c, oid)
  63. ctx.Convey("Then err should be nil.title,link should not be nil.", func(ctx convey.C) {
  64. ctx.So(err, convey.ShouldNotBeNil)
  65. ctx.So(link, convey.ShouldBeBlank)
  66. ctx.So(title, convey.ShouldBeBlank)
  67. })
  68. })
  69. })
  70. }
  71. func TestDaoLiveActivityTitle(t *testing.T) {
  72. convey.Convey("LiveActivityTitle", t, func(ctx convey.C) {
  73. var (
  74. c = context.Background()
  75. oid = int64(0)
  76. )
  77. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  78. title, link, err := _d.LiveActivityTitle(c, oid)
  79. ctx.Convey("Then err should be nil.title,link should not be nil.", func(ctx convey.C) {
  80. ctx.So(err, convey.ShouldNotBeNil)
  81. ctx.So(link, convey.ShouldBeBlank)
  82. ctx.So(title, convey.ShouldBeBlank)
  83. })
  84. })
  85. })
  86. }
  87. func TestDaoLiveNoticeTitle(t *testing.T) {
  88. convey.Convey("LiveNoticeTitle", t, func(ctx convey.C) {
  89. var (
  90. c = context.Background()
  91. oid = int64(0)
  92. )
  93. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  94. title, link, err := _d.LiveNoticeTitle(c, oid)
  95. ctx.Convey("Then err should be nil.title,link should not be nil.", func(ctx convey.C) {
  96. ctx.So(err, convey.ShouldNotBeNil)
  97. ctx.So(link, convey.ShouldBeBlank)
  98. ctx.So(title, convey.ShouldBeBlank)
  99. })
  100. })
  101. })
  102. }
  103. func TestDaoLivePictureTitle(t *testing.T) {
  104. convey.Convey("LivePictureTitle", t, func(ctx convey.C) {
  105. var (
  106. c = context.Background()
  107. oid = int64(0)
  108. )
  109. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  110. title, link, err := _d.LivePictureTitle(c, oid)
  111. ctx.Convey("Then err should be nil.title,link should not be nil.", func(ctx convey.C) {
  112. ctx.So(err, convey.ShouldNotBeNil)
  113. ctx.So(link, convey.ShouldBeBlank)
  114. ctx.So(title, convey.ShouldBeBlank)
  115. })
  116. })
  117. })
  118. }
  119. func TestDaoTopicTitle(t *testing.T) {
  120. convey.Convey("TopicTitle", t, func(ctx convey.C) {
  121. var (
  122. c = context.Background()
  123. oid = int64(0)
  124. )
  125. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  126. title, link, err := _d.TopicTitle(c, oid)
  127. ctx.Convey("Then err should be nil.title,link should not be nil.", func(ctx convey.C) {
  128. if err == nil {
  129. ctx.So(err, convey.ShouldBeNil)
  130. }
  131. ctx.So(link, convey.ShouldBeBlank)
  132. ctx.So(title, convey.ShouldBeBlank)
  133. })
  134. })
  135. })
  136. }
  137. func TestDaoTopicsLink(t *testing.T) {
  138. convey.Convey("TopicsLink", t, func(ctx convey.C) {
  139. var (
  140. c = context.Background()
  141. links map[int64]string
  142. isTopic bool
  143. )
  144. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  145. err := _d.TopicsLink(c, links, isTopic)
  146. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  147. ctx.So(err, convey.ShouldBeNil)
  148. })
  149. })
  150. })
  151. }
  152. func TestDaoActivitySub(t *testing.T) {
  153. convey.Convey("ActivitySub", t, func(ctx convey.C) {
  154. var (
  155. c = context.Background()
  156. oid = int64(0)
  157. )
  158. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  159. title, link, err := _d.ActivitySub(c, oid)
  160. ctx.Convey("Then err should be nil.title,link should not be nil.", func(ctx convey.C) {
  161. ctx.So(err, convey.ShouldNotBeNil)
  162. ctx.So(link, convey.ShouldBeBlank)
  163. ctx.So(title, convey.ShouldBeBlank)
  164. })
  165. })
  166. })
  167. }
  168. func TestDaoDynamicTitle(t *testing.T) {
  169. convey.Convey("DynamicTitle", t, func(ctx convey.C) {
  170. var (
  171. c = context.Background()
  172. oid = int64(0)
  173. )
  174. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  175. title, link, err := _d.DynamicTitle(c, oid)
  176. ctx.Convey("Then err should be nil.title,link should not be nil.", func(ctx convey.C) {
  177. ctx.So(err, convey.ShouldNotBeNil)
  178. ctx.So(link, convey.ShouldBeBlank)
  179. ctx.So(title, convey.ShouldBeBlank)
  180. })
  181. })
  182. })
  183. }