Add unit tests for testing both cases (cached/noncached).