redis_test.go 401 B

12345678910111213141516171819202122
  1. package dao
  2. import (
  3. "testing"
  4. . "github.com/smartystreets/goconvey/convey"
  5. )
  6. func TestSetLogin(t *testing.T) {
  7. Convey("TestSetLogin", t, func() {
  8. err := d.SetLogin(ctx, 1, 2)
  9. if err != nil {
  10. t.Errorf("dedeCoins err(%v)", err)
  11. }
  12. b, _ := d.Logined(ctx, 1, 2)
  13. if !b {
  14. t.Errorf("Logined should be true but get %v", b)
  15. }
  16. b, _ = d.Logined(ctx, 1, 3)
  17. So(b, ShouldNotBeNil)
  18. })
  19. }