You can create an HttpContext inside your unit test using the SimpleWorkerRequest object.
TextWriter writer = new StringWriter ();
HttpWorkerRequest httpRequest = new SimpleWorkerRequest ("virtualDir", "physicalDir", "page", "", writer);
HttpContext.Current = new HttpContext (httpRequest);
HttpContext.Current.Cache[key] = some value..