dynamic_test.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestService_DynamicRegion(t *testing.T) {
  8. Convey("test dynamic DynamicRegion", t, WithService(func(s *Service) {
  9. var rid int32 = 23
  10. res, err := s.DynamicRegion(context.Background(), rid, 1, 10)
  11. So(err, ShouldBeNil)
  12. So(res, ShouldNotBeNil)
  13. }))
  14. }
  15. func TestService_DynamicRegionTag(t *testing.T) {
  16. Convey("test dynamic DynamicRegionTag", t, WithService(func(s *Service) {
  17. var (
  18. tagID int64 = 10101
  19. rid int32 = 23
  20. )
  21. res, err := s.DynamicRegionTag(context.Background(), tagID, rid, 1, 10)
  22. So(err, ShouldBeNil)
  23. So(res, ShouldNotBeNil)
  24. }))
  25. }
  26. func TestService_DynamicRegionTotal(t *testing.T) {
  27. Convey("test dynamic DynamicRegionTotal", t, WithService(func(s *Service) {
  28. res, err := s.DynamicRegionTotal(context.Background())
  29. So(err, ShouldBeNil)
  30. So(len(res), ShouldBeGreaterThan, 0)
  31. Println(len(res))
  32. }))
  33. }
  34. func TestService_DynamicRegions(t *testing.T) {
  35. Convey("test dynamic DynamicRegions", t, WithService(func(s *Service) {
  36. res, err := s.DynamicRegions(context.Background())
  37. So(err, ShouldBeNil)
  38. So(len(res), ShouldBeGreaterThan, 0)
  39. Println(len(res))
  40. }))
  41. }