cache_test.go
cache_test.go - Overview
-
Overview This file contains tests for the cache functionality, specifically focusing on creating new caches with different providers and loading cache configurations from YAML files.
-
Detailed Documentation
TestNewCacheUnKnownProvider
- Purpose: Tests the creation of a new cache with an unknown provider. It expects the
NewCache
function to returnnil
in this case. - Parameters:
t
:*testing.T
, the testing object used for test execution and reporting.
- Returns: None
TestNewCacheInMemory
- Purpose: Tests the creation of a new cache with the "inmemory" provider. It expects the
NewCache
function to return a non-nil cache object. - Parameters:
t
:*testing.T
, the testing object used for test execution and reporting.
- Returns: None
TestNewCacheRedis
- Purpose: Tests the creation of a new cache with the "redis" provider. It expects the
NewCache
function to return a non-nil cache object. - Parameters:
t
:*testing.T
, the testing object used for test execution and reporting.
- Returns: None
TestLoadFromYAMLCacheConfig
- Purpose: Tests the loading of a cache configuration from a YAML byte slice. It asserts that no error occurs during the loading process.
- Parameters:
t
:*testing.T
, the testing object used for test execution and reporting.
- Returns: None
TestLoadFromYAMLCacheConfigFile
- Purpose: Tests the loading of a cache configuration from a YAML file. It asserts that no error occurs during the loading process.
- Parameters:
t
:*testing.T
, the testing object used for test execution and reporting.
- Returns: None
Include in Getting Started: NO