Beispiel #1
0
        public void ProcessRequest_WhiteSpaceParamKey_ThrowsException()
        {
            var context = CreateContext(key: "   ");
            var cache   = CreateCache();

            var handler = new AssetsHandler(cache);

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

            var handler = new AssetsHandler(cache);

            handler.ProcessRequest(context);
        }
Beispiel #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);
        }
Beispiel #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"));
        }
Beispiel #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"));
        }
Beispiel #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"));
        }