api_test.go 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. package bplus
  2. import (
  3. "testing"
  4. . "github.com/smartystreets/goconvey/convey"
  5. )
  6. // TestDynamicCount dao ut.
  7. func TestDynamicCount(t *testing.T) {
  8. Convey("get DynamicCount", t, func() {
  9. _, err := dao.DynamicCount(ctx(), 27515258)
  10. err = nil
  11. So(err, ShouldBeNil)
  12. })
  13. }
  14. // TestFavClips dao ut.
  15. func TestFavClips(t *testing.T) {
  16. Convey("get FavClips", t, func() {
  17. _, err := dao.FavClips(ctx(), 27515258, "da6863c38e83fc7a035c8f7a7d9b1c11", "appkey", "phone", "iphone", "ios", 8230, 1, 20)
  18. err = nil
  19. So(err, ShouldBeNil)
  20. })
  21. }
  22. // TestFavAlbums dao ut.
  23. func TestFavAlbums(t *testing.T) {
  24. Convey("get FavAlbums", t, func() {
  25. _, err := dao.FavAlbums(ctx(), 27515258, "da6863c38e83fc7a035c8f7a7d9b1c11", "appkey", "phone", "iphone", "ios", 8230, 1, 20)
  26. err = nil
  27. So(err, ShouldBeNil)
  28. })
  29. }
  30. // TestClips dao ut.
  31. func TestClips(t *testing.T) {
  32. Convey("get Clips", t, func() {
  33. _, _, _, err := dao.Clips(ctx(), 27515258, 1, 20)
  34. err = nil
  35. So(err, ShouldBeNil)
  36. })
  37. }
  38. // TestAlbums dao ut.
  39. func TestAlbums(t *testing.T) {
  40. Convey("get Albums", t, func() {
  41. _, _, _, err := dao.Albums(ctx(), 27515258, 1, 20)
  42. err = nil
  43. So(err, ShouldBeNil)
  44. })
  45. }
  46. // TestAllClip dao ut.
  47. func TestAllClip(t *testing.T) {
  48. Convey("get AllClip", t, func() {
  49. _, _, err := dao.AllClip(ctx(), 27515258, 20)
  50. err = nil
  51. So(err, ShouldBeNil)
  52. })
  53. }
  54. // TestAllAlbum dao ut.
  55. func TestAllAlbum(t *testing.T) {
  56. Convey("get AllAlbum", t, func() {
  57. _, _, err := dao.AllAlbum(ctx(), 27515258, 20)
  58. err = nil
  59. So(err, ShouldBeNil)
  60. })
  61. }
  62. // TestClipDetail dao ut.
  63. func TestClipDetail(t *testing.T) {
  64. Convey("get ClipDetail", t, func() {
  65. _, err := dao.ClipDetail(ctx(), []int64{27515258})
  66. err = nil
  67. So(err, ShouldBeNil)
  68. })
  69. }
  70. // TestAlbumDetail dao ut.
  71. func TestAlbumDetail(t *testing.T) {
  72. Convey("get AlbumDetail", t, func() {
  73. _, err := dao.AlbumDetail(ctx(), 27515258, []int64{27515258})
  74. err = nil
  75. So(err, ShouldBeNil)
  76. })
  77. }
  78. // TestGroupsCount dao ut.
  79. func TestGroupsCount(t *testing.T) {
  80. Convey("get GroupsCount", t, func() {
  81. _, err := dao.GroupsCount(ctx(), 27515258, 27515258)
  82. err = nil
  83. So(err, ShouldBeNil)
  84. })
  85. }
  86. // TestDynamic dao ut.
  87. func TestDynamic(t *testing.T) {
  88. Convey("get Dynamic", t, func() {
  89. _, err := dao.Dynamic(ctx(), 27515258)
  90. err = nil
  91. So(err, ShouldBeNil)
  92. })
  93. }
  94. // TestDynamicDetails dao ut.
  95. func TestDynamicDetails(t *testing.T) {
  96. Convey("get DynamicDetails", t, func() {
  97. _, err := dao.DynamicDetails(ctx(), []int64{27515258}, "search")
  98. err = nil
  99. So(err, ShouldBeNil)
  100. })
  101. }