toview_test.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. // TestService_AddHistory
  8. func TestService_Toview(t *testing.T) {
  9. var (
  10. c = context.TODO()
  11. mid int64 = 27515316
  12. aids = []int64{27515316, 27515316}
  13. ip = ""
  14. pn = 1
  15. ps = 10000
  16. )
  17. Convey("toview ", t, WithService(func(s *Service) {
  18. Convey("toview AddMultiToView", func() {
  19. err := s.AddMultiToView(c, mid, aids, ip)
  20. So(err, ShouldBeNil)
  21. })
  22. Convey("toview RemainingToView", func() {
  23. _, err := s.RemainingToView(c, mid, "")
  24. So(err, ShouldBeNil)
  25. })
  26. Convey("toview ClearToView", func() {
  27. err := s.ClearToView(c, mid)
  28. So(err, ShouldBeNil)
  29. })
  30. Convey("toview DelToView", func() {
  31. err := s.DelToView(c, mid, aids, true, "")
  32. So(err, ShouldBeNil)
  33. })
  34. Convey("toview cache del", func() {
  35. _, _, err := s.ToView(c, mid, pn, ps, ip)
  36. So(err, ShouldBeNil)
  37. })
  38. Convey("toview Manager", func() {
  39. _, err := s.ManagerToView(c, mid, ip)
  40. So(err, ShouldBeNil)
  41. })
  42. }))
  43. }