code_test.go 681 B

123456789101112131415161718192021222324252627282930313233
  1. package service
  2. import (
  3. "testing"
  4. "time"
  5. "go-common/app/admin/main/coupon/model"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. // go test -test.v -test.run TestBatchInfo
  9. func TestInitCodes(t *testing.T) {
  10. Convey("TestInitCodes ", t, func() {
  11. err := s.InitCodes(c, "allowance_batch100")
  12. time.Sleep(2 * time.Second)
  13. So(err, ShouldBeNil)
  14. })
  15. }
  16. func TestCodeBlock(t *testing.T) {
  17. Convey("TestCodeBlock ", t, func() {
  18. err := s.CodeBlock(c, &model.ArgCouponCode{ID: 103})
  19. So(err, ShouldBeNil)
  20. })
  21. }
  22. func TestCodeUnBlock(t *testing.T) {
  23. Convey("TestCodeUnBlock ", t, func() {
  24. err := s.CodeUnBlock(c, &model.ArgCouponCode{ID: 103})
  25. So(err, ShouldBeNil)
  26. })
  27. }