mc.cache_test.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestDaoequipKey(t *testing.T) {
  8. convey.Convey("equipKey", t, func(ctx convey.C) {
  9. var (
  10. mid = int64(0)
  11. )
  12. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  13. p1 := equipKey(mid)
  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 TestDaopingMC(t *testing.T) {
  21. convey.Convey("pingMC", t, func(ctx convey.C) {
  22. var (
  23. c = context.Background()
  24. )
  25. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  26. err := d.pingMC(c)
  27. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  28. ctx.So(err, convey.ShouldBeNil)
  29. })
  30. })
  31. })
  32. }
  33. func TestDaoDelCacheEquip(t *testing.T) {
  34. convey.Convey("DelCacheEquip", t, func(ctx convey.C) {
  35. var (
  36. c = context.Background()
  37. id = int64(0)
  38. )
  39. ctx.Convey("When everything goes positive", func(ctx convey.C) {
  40. err := d.DelCacheEquip(c, id)
  41. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  42. ctx.So(err, convey.ShouldBeNil)
  43. })
  44. })
  45. })
  46. }