public void ProcessRequest_WhiteSpaceParamKey_ThrowsException() { var context = CreateContext(key: " "); var cache = CreateCache(); var handler = new AssetsHandler(cache); handler.ProcessRequest(context); }
public void ProcessRequest_IncorrectParamType_ThrowsException() { var context = CreateContext(type: "zzzz"); var cache = CreateCache(); var handler = new AssetsHandler(cache); handler.ProcessRequest(context); }
public void ProcessRequest_NoCachedKey_ThrowsException() { var context = CreateContext(); var emptyCache = CreateCache(key: null, content: null); var handler = new AssetsHandler(emptyCache); handler.ProcessRequest(context); }
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")); }
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")); }
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")); }