newlist_test.go 677 B

1234567891011121314151617181920212223242526
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestService_NewList1(t *testing.T) {
  8. Convey("should return without err", t, WithService(func(svf *Service) {
  9. res, count, err := svf.NewList(context.Background(), 129, 1, 1, 10)
  10. So(err, ShouldBeNil)
  11. So(count, ShouldBeGreaterThan, 0)
  12. So(len(res), ShouldBeGreaterThan, 0)
  13. }))
  14. }
  15. func TestService_NewList2(t *testing.T) {
  16. Convey("should return without err", t, WithService(func(svf *Service) {
  17. res, count, err := svf.NewList(context.Background(), 1, 1, 1, 10)
  18. So(err, ShouldBeNil)
  19. So(count, ShouldBeGreaterThan, 0)
  20. So(len(res), ShouldBeGreaterThan, 0)
  21. }))
  22. }