help_test.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestService_HelpList(t *testing.T) {
  8. Convey("test help HelpList", t, WithService(func(s *Service) {
  9. pTypeID := "39e79104ca5d433f9d9cdf9df4bf28a0"
  10. res, err := s.HelpList(context.Background(), pTypeID)
  11. So(err, ShouldBeNil)
  12. So(len(res), ShouldBeGreaterThan, 0)
  13. Println(len(res))
  14. }))
  15. }
  16. func TestService_HelpDetail(t *testing.T) {
  17. Convey("test help HelpDetail", t, WithService(func(s *Service) {
  18. fID := "39e79104ca5d433f9d9cdf9df4bf28a0"
  19. qTypeID := "39e79104ca5d433f9d9cdf9df4bf28a0"
  20. resD, resL, total, err := s.HelpDetail(context.Background(), fID, qTypeID, 0, 1, 15)
  21. So(err, ShouldBeNil)
  22. So(total, ShouldBeGreaterThan, 0)
  23. So(len(resD), ShouldBeGreaterThan, 0)
  24. Println(len(resD))
  25. So(len(resL), ShouldBeGreaterThan, 0)
  26. Println(len(resL))
  27. }))
  28. }
  29. func TestService_HelpSearch(t *testing.T) {
  30. Convey("test help HelpSearch", t, WithService(func(s *Service) {
  31. pTypeID := "39e79104ca5d433f9d9cdf9df4bf28a0"
  32. keyWords := "aaa"
  33. res, total, err := s.HelpSearch(context.Background(), pTypeID, keyWords, 0, 1, 15)
  34. So(err, ShouldBeNil)
  35. So(total, ShouldBeGreaterThan, 0)
  36. So(len(res), ShouldBeGreaterThan, 0)
  37. Println(len(res))
  38. }))
  39. }