promotion_group_test.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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_AddPromoGroup(t *testing.T) {
  9. Convey("AddPromoGroup", t, func() {
  10. res, err := d.AddPromoGroup(context.TODO(), 1, 1, 1, 1, 1, 1)
  11. So(err, ShouldBeNil)
  12. t.Logf("res:%v", res)
  13. })
  14. }
  15. func TestDao_RawPromoGroup(t *testing.T) {
  16. Convey("RawPromoGroup", t, func() {
  17. res, err := d.PromoGroup(context.TODO(), 1)
  18. So(err, ShouldBeNil)
  19. t.Logf("res:%v", res)
  20. })
  21. }
  22. func TestDao_CachePromoGroup(t *testing.T) {
  23. Convey("CachePromoGroup", t, func() {
  24. res, err := d.CachePromoGroup(context.TODO(), 1)
  25. So(err, ShouldBeNil)
  26. t.Logf("res:%v", res)
  27. })
  28. }
  29. func TestDao_AddCachePromoGroup(t *testing.T) {
  30. Convey("AddCachePromoGroup", t, func() {
  31. err := d.AddCachePromoGroup(context.TODO(), 1, &model.PromotionGroup{PromoID: 1})
  32. So(err, ShouldBeNil)
  33. })
  34. }
  35. func TestDao_DelCacheGroup(t *testing.T) {
  36. Convey("DelCacheGroup", t, func() {
  37. d.DelCachePromoGroup(context.TODO(), 1)
  38. })
  39. }
  40. func TestDao_GetUserGroupDoing(t *testing.T) {
  41. Convey("GetUserGroupDoing", t, func() {
  42. res, err := d.GetUserGroupDoing(context.TODO(), 1, 1, 1)
  43. So(err, ShouldBeNil)
  44. t.Logf("res:%v", res)
  45. })
  46. }
  47. func TestDao_UpdateGroupStatusAndOrderCount(t *testing.T) {
  48. Convey("UpdateGroupStatusAndOrderCount", t, func() {
  49. res, err := d.UpdateGroupStatusAndOrderCount(context.TODO(), 1, 1, 1, 1)
  50. So(err, ShouldBeNil)
  51. t.Logf("res:%v", res)
  52. })
  53. }