Unit tests for cache.