Added tests for Cache::read, also added checks for file writes.