view_test.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package view
  2. import (
  3. "context"
  4. "fmt"
  5. "testing"
  6. "time"
  7. . "github.com/smartystreets/goconvey/convey"
  8. )
  9. func Test_View(t *testing.T) {
  10. Convey("View", t, func() {
  11. v, err := s.View(context.TODO(), 1, 10111556, 0, 0, 10000, 0, 0, 0, 0, 0, "", "", "", "", "", "", "", "", time.Now())
  12. Println(v, err)
  13. })
  14. }
  15. func Test_ViewPage(t *testing.T) {
  16. Convey("ViewPage", t, func() {
  17. v, err := s.ViewPage(context.TODO(), 1, 1, 0, 0, 0, "", "", "", "", true, time.Now())
  18. Println(v, err)
  19. })
  20. }
  21. func Test_AddShare(t *testing.T) {
  22. Convey("AddShare", t, func() {
  23. _, _, _, err := s.AddShare(context.TODO(), 1, 1684013, "127.0.0.1")
  24. So(err, ShouldBeNil)
  25. })
  26. }
  27. func Test_Shot(t *testing.T) {
  28. Convey("Shot", t, func() {
  29. shot, _ := s.Shot(context.TODO(), 10106351, 10126396)
  30. fmt.Printf("===%+v===", shot)
  31. })
  32. }
  33. func Test_Like(t *testing.T) {
  34. Convey("Like", t, func() {
  35. s.Like(context.TODO(), 1, 1, 0)
  36. })
  37. }
  38. func Test_AddCoin(t *testing.T) {
  39. Convey("AddCoin", t, func() {
  40. s.AddCoin(context.TODO(), 1, 1684013, 2, 0, 1, "", 0)
  41. })
  42. }
  43. func Test_AddFav(t *testing.T) {
  44. Convey("AddFav", t, func() {
  45. _, err := s.AddFav(context.TODO(), 2, 1684013, []int64{1}, 1, "")
  46. So(err, ShouldBeNil)
  47. })
  48. }
  49. func Test_Paster(t *testing.T) {
  50. Convey("Paster", t, func() {
  51. s.Paster(context.TODO(), 1, 1, "1", "1", "")
  52. })
  53. }
  54. func Test_VipPlayURL(t *testing.T) {
  55. Convey("VipPlayURL", t, func() {
  56. s.VipPlayURL(context.TODO(), 1, 1, 1684013)
  57. })
  58. }