(t *testing.T)
| 250 | } |
| 251 | |
| 252 | func TestInMemoryRefreshTokenStore_Count(t *testing.T) { |
| 253 | store := NewInMemoryRefreshTokenStore() |
| 254 | |
| 255 | // Initially empty |
| 256 | count, err := store.Count(context.Background()) |
| 257 | if err != nil { |
| 258 | t.Fatalf("Count() returned error: %v", err) |
| 259 | } |
| 260 | if count != 0 { |
| 261 | t.Fatalf("Expected initial count to be 0, got %d", count) |
| 262 | } |
| 263 | |
| 264 | // Add tokens |
| 265 | expiry := time.Now().Add(time.Hour) |
| 266 | for i := 0; i < 5; i++ { |
| 267 | token := fmt.Sprintf("token%d", i) |
| 268 | user := &User{ID: fmt.Sprintf("%d", i)} |
| 269 | _ = store.Set(context.Background(), token, user, expiry) |
| 270 | } |
| 271 | |
| 272 | count, err = store.Count(context.Background()) |
| 273 | if err != nil { |
| 274 | t.Fatalf("Count() returned error: %v", err) |
| 275 | } |
| 276 | if count != 5 { |
| 277 | t.Fatalf("Expected count to be 5, got %d", count) |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | func TestInMemoryRefreshTokenStore_GetAll(t *testing.T) { |
| 282 | store := NewInMemoryRefreshTokenStore() |
nothing calls this directly
no test coverage detected
searching dependent graphs…