added unit tests for cache