price_config_test.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoPriceConfigsByStatus(t *testing.T) {
  8. convey.Convey("PriceConfigsByStatus", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. status = int8(0)
  12. )
  13. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  14. res, total, err := d.PriceConfigsByStatus(c, status)
  15. ctx.Convey("Then err should be nil.res,total should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. ctx.So(total, convey.ShouldNotBeNil)
  18. ctx.So(res, convey.ShouldNotBeNil)
  19. })
  20. })
  21. })
  22. }
  23. func TestDaoSaledPriceConfigsByStatus(t *testing.T) {
  24. convey.Convey("SaledPriceConfigsByStatus", t, func(ctx convey.C) {
  25. var (
  26. c = context.Background()
  27. status = int8(0)
  28. )
  29. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  30. res, total, err := d.SaledPriceConfigsByStatus(c, status)
  31. ctx.Convey("Then err should be nil.res,total should not be nil.", func(ctx convey.C) {
  32. ctx.So(err, convey.ShouldBeNil)
  33. ctx.So(total, convey.ShouldNotBeNil)
  34. ctx.So(res, convey.ShouldNotBeNil)
  35. })
  36. })
  37. })
  38. }