go-common/app/admin/main/reply/service/business_test.go

31 lines
863 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package service
import (
"context"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestService_Business(t *testing.T) {
c := context.Background()
Convey("test service business", c, WithService(func(s *Service) {
Convey("test service add business", c, WithService(func(s *Service) {
_, err := s.AddBusiness(c, -3, "abc", "abc", "abc", "abc")
So(err, ShouldBeNil)
}))
Convey("test service list business", c, WithService(func(s *Service) {
_, err := s.ListBusiness(c, 0)
So(err, ShouldBeNil)
}))
Convey("test service update business", c, WithService(func(s *Service) {
_, err := s.UpBusiness(c, "test", "test", "test", "abc", -3)
So(err, ShouldBeNil)
}))
Convey("test service update business state", c, WithService(func(s *Service) {
_, err := s.UpBusinessState(c, 1, -3)
So(err, ShouldBeNil)
}))
}))
}