I\'m trying to implement a unit test for a function in a project that doesn\'t have unit tests and this function requires a System.Web.Caching.Cache object as a parameter. I\'ve
var httpResponse = MockRepository.GenerateMock(); var cache = MockRepository.GenerateMock(); cache.Stub(x => x.SetOmitVaryStar(true)); httpResponse.Stub(x => x.Cache).Return(cache); httpContext.Stub(x => x.Response).Return(httpResponse); httpContext.Response.Stub(x => x.Cache).Return(cache);