upper_test.go 947 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package service
  2. import (
  3. "testing"
  4. "fmt"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestService_AddMids(t *testing.T) {
  8. Convey("TestService_CheckMids Test", t, WithService(func(s *Service) {
  9. res, err := s.AddMids([]int64{
  10. 1, 2, 3, 777777777777, 999,
  11. })
  12. So(err, ShouldBeNil)
  13. fmt.Println(res)
  14. }))
  15. }
  16. func TestService_ImportMids(t *testing.T) {
  17. Convey("TestService_ImportMids Test", t, WithService(func(s *Service) {
  18. res, err := s.ImportMids([]int64{
  19. 1, 2, 3, 777777777777, 999,
  20. })
  21. So(err, ShouldBeNil)
  22. fmt.Println(res)
  23. }))
  24. }
  25. func TestService_DelMid(t *testing.T) {
  26. Convey("TestService_DelMid Test", t, WithService(func(s *Service) {
  27. err := s.DelMid(2)
  28. So(err, ShouldBeNil)
  29. }))
  30. }
  31. func TestService_UpList(t *testing.T) {
  32. Convey("TestService_UpList Test", t, WithService(func(s *Service) {
  33. res, err := s.UpList(2, 1, "", 0)
  34. So(err, ShouldBeNil)
  35. So(len(res.Items), ShouldBeGreaterThan, 0)
  36. }))
  37. }