redis_test.go 858 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestPushList(t *testing.T) {
  8. var (
  9. c = context.Background()
  10. )
  11. convey.Convey("PushList", t, func(ctx convey.C) {
  12. err := d.PushList(c, nil)
  13. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  14. ctx.So(err, convey.ShouldBeNil)
  15. })
  16. })
  17. }
  18. func TestPopList(t *testing.T) {
  19. var (
  20. c = context.Background()
  21. )
  22. convey.Convey("PopList", t, func(ctx convey.C) {
  23. _, err := d.PopList(c)
  24. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  25. ctx.So(err, convey.ShouldBeNil)
  26. })
  27. })
  28. }
  29. func TestPingRedis(t *testing.T) {
  30. var (
  31. c = context.Background()
  32. )
  33. convey.Convey("PingRedis", t, func(ctx convey.C) {
  34. err := d.PingRedis(c)
  35. ctx.Convey("Then err should be nil.", func(ctx convey.C) {
  36. ctx.So(err, convey.ShouldBeNil)
  37. })
  38. })
  39. }