Ejemplo n.º 1
0
        public void Init()
        {
            _context = MockRepository.GenerateMock<IEngineContext>();
            _context
                .Stub(x => x.Services)
                .Return(MockRepository.GenerateMock<IMonoRailServices>());
            _context.Services
                .Stub(x => x.CacheProvider)
                .Return(MockRepository.GenerateMock<ICacheProvider>());

            var httpContext = new HttpContext(new HttpRequest("", "http://localhost", ""), new HttpResponse(null));

            _context
                .Stub(x => x.UnderlyingContext)
                .Return(httpContext);

            foreach (var key in HttpRuntime.Cache.OfType<DictionaryEntry>().Select(x=>x.Key))
                HttpRuntime.Cache.Remove(Convert.ToString(key));
        }
        public void Init()
        {
            _context = MockRepository.GenerateMock <IEngineContext>();
            _context
            .Stub(x => x.Services)
            .Return(MockRepository.GenerateMock <IMonoRailServices>());
            _context.Services
            .Stub(x => x.CacheProvider)
            .Return(MockRepository.GenerateMock <ICacheProvider>());

            var httpContext = new HttpContext(new HttpRequest("", "http://localhost", ""), new HttpResponse(null));

            _context
            .Stub(x => x.UnderlyingContext)
            .Return(httpContext);

            foreach (var key in HttpRuntime.Cache.OfType <DictionaryEntry>().Select(x => x.Key))
            {
                HttpRuntime.Cache.Remove(Convert.ToString(key));
            }
        }