memcache_test.go 880 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package dao
  2. import (
  3. "context"
  4. "testing"
  5. "github.com/smartystreets/goconvey/convey"
  6. )
  7. func TestVipInfoKey(t *testing.T) {
  8. convey.Convey("vipInfoKey", t, func() {
  9. p1 := vipInfoKey(0)
  10. convey.So(p1, convey.ShouldNotBeNil)
  11. })
  12. }
  13. func TestDaoSetSelCode(t *testing.T) {
  14. convey.Convey("SetSelCode", t, func() {
  15. linkmap := map[int64]int64{1: 1}
  16. err := d.SetSelCode(context.TODO(), "testSelCode", linkmap)
  17. convey.So(err, convey.ShouldBeNil)
  18. })
  19. convey.Convey("GetSelCode", t, func() {
  20. _, err := d.GetSelCode(context.TODO(), "testSelCode")
  21. convey.So(err, convey.ShouldBeNil)
  22. })
  23. convey.Convey("DelSelCode", t, func() {
  24. err := d.DelSelCode(context.TODO(), "testSelCode")
  25. convey.So(err, convey.ShouldBeNil)
  26. })
  27. }
  28. func TestDaoPingMC(t *testing.T) {
  29. convey.Convey("PingMC", t, func() {
  30. err := d.PingMC(context.TODO())
  31. convey.So(err, convey.ShouldBeNil)
  32. })
  33. }