elec_mc_test.go 955 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoAddCacheOrderID(t *testing.T) {
  8. convey.Convey("AddCacheOrderID", t, func(ctx convey.C) {
  9. var (
  10. c = context.Background()
  11. orderID = "233"
  12. )
  13. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  14. ok, err := d.AddCacheOrderID(c, orderID)
  15. ctx.Convey("Then err should be nil.ok should not be nil.", func(ctx convey.C) {
  16. ctx.So(err, convey.ShouldBeNil)
  17. ctx.So(ok, convey.ShouldNotBeNil)
  18. })
  19. })
  20. })
  21. }
  22. func TestDaoDelCacheOrderID(t *testing.T) {
  23. convey.Convey("DelCacheOrderID", t, func(ctx convey.C) {
  24. var (
  25. c = context.Background()
  26. orderID = "233"
  27. )
  28. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  29. err := d.DelCacheOrderID(c, orderID)
  30. ctx.Convey("Then err should be nil.ok should not be nil.", func(ctx convey.C) {
  31. ctx.So(err, convey.ShouldBeNil)
  32. })
  33. })
  34. })
  35. }