promotion_test.go 1004 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/service/openplatform/ticket-sales/model"
  5. "testing"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDao_RawPromo(t *testing.T) {
  9. Convey("RawPromo", t, func() {
  10. res, err := d.RawPromo(context.TODO(), 1)
  11. So(err, ShouldBeNil)
  12. t.Logf("res:%v", res)
  13. })
  14. }
  15. func TestDao_CachePromo(t *testing.T) {
  16. Convey("CachePromo", t, func() {
  17. res, err := d.CachePromo(context.TODO(), 1)
  18. So(err, ShouldBeNil)
  19. t.Logf("res:%v", res)
  20. })
  21. }
  22. func TestDao_AddCachePromo(t *testing.T) {
  23. Convey("AddCachePromo", t, func() {
  24. err := d.AddCachePromo(context.TODO(), 1, &model.Promotion{PromoID: 1})
  25. So(err, ShouldBeNil)
  26. })
  27. }
  28. func TestDao_DelCachePromo(t *testing.T) {
  29. Convey("DelCachePromo", t, func() {
  30. d.DelCachePromo(context.TODO(), 1)
  31. })
  32. }
  33. func TestDao_CreatePromo(t *testing.T) {
  34. Convey("CreatePromo", t, func() {
  35. res, err := d.CreatePromo(context.TODO(), &model.Promotion{PromoID: 1})
  36. So(err, ShouldBeNil)
  37. t.Logf("res:%v", res)
  38. })
  39. }