memcache_test.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. package up
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestUpmcnSignKey(t *testing.T) {
  8. convey.Convey("mcnSignKey", t, func(ctx convey.C) {
  9. var (
  10. mcnMid = int64(0)
  11. )
  12. ctx.Convey("When everything gose 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 TestUpmcnUpperKey(t *testing.T) {
  21. convey.Convey("mcnUpperKey", t, func(ctx convey.C) {
  22. var (
  23. signID = int64(0)
  24. upMid = int64(0)
  25. )
  26. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  27. p1 := mcnUpperKey(signID, upMid)
  28. ctx.Convey("Then p1 should not be nil.", func(ctx convey.C) {
  29. ctx.So(p1, convey.ShouldNotBeNil)
  30. })
  31. })
  32. })
  33. }
  34. func TestUpDelMcnSignCache(t *testing.T) {
  35. convey.Convey("DelMcnSignCache", t, func(ctx convey.C) {
  36. var (
  37. c = context.Background()
  38. mcnMid = int64(0)
  39. )
  40. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  41. err := d.DelMcnSignCache(c, mcnMid)
  42. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  43. ctx.So(err, convey.ShouldBeNil)
  44. })
  45. })
  46. })
  47. }
  48. func TestUpDelMcnUpperCache(t *testing.T) {
  49. convey.Convey("DelMcnUpperCache", t, func(ctx convey.C) {
  50. var (
  51. c = context.Background()
  52. signID = int64(0)
  53. upMid = int64(0)
  54. )
  55. ctx.Convey("When everything gose positive", func(ctx convey.C) {
  56. err := d.DelMcnUpperCache(c, signID, upMid)
  57. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  58. ctx.So(err, convey.ShouldBeNil)
  59. })
  60. })
  61. })
  62. }