Exemplo n.º 1
0
        public void ProcessRequest_WhiteSpaceParamKey_ThrowsException()
        {
            var context = CreateContext(key: "   ");
            var cache   = CreateCache();

            var handler = new AssetsHandler(cache);

            handler.ProcessRequest(context);
        }
Exemplo n.º 2
0
        public void ProcessRequest_IncorrectParamType_ThrowsException()
        {
            var context = CreateContext(type: "zzzz");
            var cache   = CreateCache();

            var handler = new AssetsHandler(cache);

            handler.ProcessRequest(context);
        }
Exemplo n.º 3
0
        public void ProcessRequest_NoCachedKey_ThrowsException()
        {
            var context    = CreateContext();
            var emptyCache = CreateCache(key: null, content: null);

            var handler = new AssetsHandler(emptyCache);

            handler.ProcessRequest(context);
        }
Exemplo n.º 4
0
        public void ProcessRequest_ValidSetup_WritesContent()
        {
            var context = CreateContext();
            var cache   = CreateCache();

            var handler = new AssetsHandler(cache);

            handler.ProcessRequest(context);

            Assert.That(_lastResponseWritten, Is.EqualTo("test-content"));
        }
Exemplo n.º 5
0
        public void ProcessRequest_ValidSetup_SetsJavascriptContentType()
        {
            var context = CreateContext(type: "Javascript");
            var cache   = CreateCache();

            var handler = new AssetsHandler(cache);

            handler.ProcessRequest(context);

            Assert.That(_lastContentTypeSet, Is.EqualTo("application/javascript"));
        }
Exemplo n.º 6
0
        public void ProcessRequest_ValidSetup_SetsCssContentType()
        {
            var context = CreateContext();
            var cache   = CreateCache();

            var handler = new AssetsHandler(cache);

            handler.ProcessRequest(context);

            Assert.That(_lastContentTypeSet, Is.EqualTo("text/css"));
        }