business_test.go 863 B

123456789101112131415161718192021222324252627282930
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. . "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestService_Business(t *testing.T) {
  8. c := context.Background()
  9. Convey("test service business", c, WithService(func(s *Service) {
  10. Convey("test service add business", c, WithService(func(s *Service) {
  11. _, err := s.AddBusiness(c, -3, "abc", "abc", "abc", "abc")
  12. So(err, ShouldBeNil)
  13. }))
  14. Convey("test service list business", c, WithService(func(s *Service) {
  15. _, err := s.ListBusiness(c, 0)
  16. So(err, ShouldBeNil)
  17. }))
  18. Convey("test service update business", c, WithService(func(s *Service) {
  19. _, err := s.UpBusiness(c, "test", "test", "test", "abc", -3)
  20. So(err, ShouldBeNil)
  21. }))
  22. Convey("test service update business state", c, WithService(func(s *Service) {
  23. _, err := s.UpBusinessState(c, 1, -3)
  24. So(err, ShouldBeNil)
  25. }))
  26. }))
  27. }