mirror of
https://github.com/SamyRai/tercul-backend.git
synced 2025-12-27 05:11:34 +00:00
This commit introduces a comprehensive test suite for the `RedisCache` implementation in `internal/platform/cache/redis_cache.go`. The following changes were made: - Added `go-redis/redismock/v9` as a dev dependency to mock the Redis client. - Created `internal/platform/cache/redis_cache_test.go` with tests for all public methods of `RedisCache`. - Covered various scenarios, including success cases, cache misses, and Redis errors. - Tested basic operations (Get, Set, Delete, Clear), multi-key operations (GetMulti, SetMulti), entity-specific helpers, and the `InvalidateEntityType` method. This effort increased the test coverage for the `internal/platform/cache` package from 10.3% to 89.7%, contributing to the overall goal of achieving >80% test coverage for the project. |
||
|---|---|---|
| .. | ||
| auth | ||
| cache | ||
| config | ||
| db | ||
| http | ||
| log | ||
| openlibrary | ||
| search | ||