mc_test.go 816 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package block
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestBlockuserKey(t *testing.T) {
  8. convey.Convey("userKey", t, func(ctx convey.C) {
  9. var (
  10. mid = int64(46333)
  11. )
  12. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  13. key := userKey(mid)
  14. ctx.Convey("Then key should not be nil.", func(ctx convey.C) {
  15. ctx.So(key, convey.ShouldEqual, "u_46333")
  16. })
  17. })
  18. })
  19. }
  20. func TestBlockDeleteUserCache(t *testing.T) {
  21. convey.Convey("DeleteUserCache", t, func(ctx convey.C) {
  22. var (
  23. c = context.Background()
  24. mid = int64(1)
  25. )
  26. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  27. err := d.DeleteUserCache(c, mid)
  28. ctx.Convey("test DeleteUserCache", func(ctx convey.C) {
  29. ctx.So(err, convey.ShouldBeNil)
  30. })
  31. })
  32. })
  33. }