memcache_test.go 822 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaomcnSignKey(t *testing.T) {
  8. convey.Convey("mcnSignKey", t, func(ctx convey.C) {
  9. var (
  10. mcnMid = int64(0)
  11. )
  12. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  13. p1 := mcnSignKey(mcnMid)
  14. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  15. ctx.So(p1, convey.ShouldNotBeNil)
  16. })
  17. })
  18. })
  19. }
  20. func TestDaoDelMcnSignCache(t *testing.T) {
  21. convey.Convey("DelMcnSignCache", t, func(ctx convey.C) {
  22. var (
  23. c = context.Background()
  24. mcnMid = int64(0)
  25. )
  26. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  27. err := d.DelMcnSignCache(c, mcnMid)
  28. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  29. ctx.So(err, convey.ShouldBeNil)
  30. })
  31. })
  32. })
  33. }