index2_test.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package feed
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestService_Index2(t *testing.T) {
  9. Convey(t.Name(), t, func() {
  10. gotIs, gotConfig, gotInfoc, err := s.Index2(context.Background(), "", 0, 0, nil, 1, time.Now())
  11. So(gotIs, ShouldNotBeNil)
  12. So(gotConfig, ShouldNotBeNil)
  13. So(gotInfoc, ShouldNotBeNil)
  14. So(err, ShouldBeNil)
  15. })
  16. }
  17. func TestService_indexBanner2(t *testing.T) {
  18. Convey(t.Name(), t, func() {
  19. gotBanners, gotVersion, err := s.indexBanner2(context.Background(), 0, "", 0, nil)
  20. So(gotBanners, ShouldNotBeNil)
  21. So(gotVersion, ShouldNotBeNil)
  22. So(err, ShouldBeNil)
  23. })
  24. }
  25. func TestService_mergeItem2(t *testing.T) {
  26. Convey(t.Name(), t, func() {
  27. gotIs, gotAdInfom := s.mergeItem2(context.Background(), 0, 0, nil, nil, nil, nil, "", nil, nil, false)
  28. So(gotIs, ShouldNotBeNil)
  29. So(gotAdInfom, ShouldNotBeNil)
  30. })
  31. }
  32. func TestService_dealAdLoc(t *testing.T) {
  33. Convey(t.Name(), t, func() {
  34. s.dealAdLoc(nil, nil, nil, time.Now())
  35. })
  36. }
  37. func TestService_dealItem2(t *testing.T) {
  38. Convey(t.Name(), t, func() {
  39. gotIs, gotIsAI := s.dealItem2(context.Background(), 0, "", 0, nil, nil, false, false, false, nil, time.Now())
  40. So(gotIs, ShouldNotBeNil)
  41. So(gotIsAI, ShouldNotBeNil)
  42. })
  43. }
  44. func TestService_Converge(t *testing.T) {
  45. Convey(t.Name(), t, func() {
  46. gotIs, gotConverge, err := s.Converge(context.Background(), 0, 0, nil, time.Now())
  47. So(gotIs, ShouldNotBeNil)
  48. So(gotConverge, ShouldNotBeNil)
  49. So(err, ShouldBeNil)
  50. })
  51. }