coupon_test.go 1023 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package dao
  2. import (
  3. "context"
  4. "go-common/app/job/main/vip/model"
  5. "testing"
  6. "time"
  7. "github.com/smartystreets/goconvey/convey"
  8. )
  9. func TestDaoSalaryVideoCouponList(t *testing.T) {
  10. convey.Convey("SalaryVideoCouponList", t, func(ctx convey.C) {
  11. var (
  12. c = context.Background()
  13. mid = int64(0)
  14. dv = "2018_09"
  15. )
  16. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  17. _, err := d.SalaryVideoCouponList(c, mid, dv)
  18. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  19. ctx.So(err, convey.ShouldBeNil)
  20. })
  21. })
  22. })
  23. }
  24. func TestDaoAddSalaryLog(t *testing.T) {
  25. convey.Convey("AddSalaryLog", t, func(ctx convey.C) {
  26. var (
  27. c = context.Background()
  28. l = &model.VideoCouponSalaryLog{
  29. Mid: time.Now().Unix(),
  30. }
  31. dv = "2018_09"
  32. )
  33. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  34. err := d.AddSalaryLog(c, l, dv)
  35. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  36. ctx.So(err, convey.ShouldBeNil)
  37. })
  38. })
  39. })
  40. }