dao.cache_test.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package mcndao
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestMcndaoMcnSign(t *testing.T) {
  9. convey.Convey("McnSign", t, func(ctx convey.C) {
  10. var (
  11. c = context.Background()
  12. id = int64(0)
  13. )
  14. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  15. res, err := d.McnSign(c, id)
  16. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  17. ctx.So(err, convey.ShouldBeNil)
  18. ctx.So(res, convey.ShouldBeNil)
  19. })
  20. })
  21. })
  22. }
  23. func TestMcndaoMcnDataSummary(t *testing.T) {
  24. convey.Convey("McnDataSummary", t, func(ctx convey.C) {
  25. var (
  26. c = context.Background()
  27. id = int64(0)
  28. generateDate = time.Now()
  29. )
  30. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  31. res, err := d.McnDataSummary(c, id, generateDate)
  32. ctx.Convey("Then err should be nil.res should not be nil.", func(ctx convey.C) {
  33. ctx.So(err, convey.ShouldBeNil)
  34. ctx.So(res, convey.ShouldBeNil)
  35. })
  36. })
  37. })
  38. }