discount_plan_test.go 542 B

12345678910111213141516171819202122232425
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestDaoGetDiscountPlan(t *testing.T) {
  9. convey.Convey("GetDiscountPlan", t, func(c convey.C) {
  10. var (
  11. ctx = context.Background()
  12. now = time.Now()
  13. )
  14. c.Convey("When everything gose positive", func(c convey.C) {
  15. plans, err := d.GetDiscountPlan(ctx, now)
  16. c.Convey("Then err should be nil.plans should not be nil.", func(c convey.C) {
  17. c.So(err, convey.ShouldBeNil)
  18. c.So(plans, convey.ShouldNotBeNil)
  19. })
  20. })
  21. })
  22. }