Beispiel #1
0
        public void ContentTypeIsTextCss()
        {
            CssResponse.WriteHeaders();
            CssResponse.WriteCss(null);

            HttpResponse.VerifySet(r => r.ContentType = "text/css", Times.Once());
        }
Beispiel #2
0
        public void CssIsWrittenToResponse()
        {
            var str = "testing";

            CssResponse.WriteCss(str);

            HttpResponse.Verify(r => r.Write(str), Times.Once());
        }
Beispiel #3
0
 public void Process(ISemanticProcessor proc, IMembrane membrane, CssResponse resp)
 {
     byte[] utf8data = resp.Script.to_Utf8();
     resp.Context.Response.ContentType     = "text/css";
     resp.Context.Response.ContentEncoding = Encoding.UTF8;
     resp.Context.Response.ContentLength64 = utf8data.Length;
     resp.Context.Response.OutputStream.Write(utf8data, 0, utf8data.Length);
     resp.Context.Response.Close();
 }
Beispiel #4
0
 public void Process(ISemanticProcessor proc, IMembrane membrane, CssResponse resp)
 {
     // resp.Context.Response.ContentLength64 = resp.Script.Length;
     if (resp.Context.Request.AcceptEncoding)
     {
         resp.Context.Response.WriteCompressed(resp.Script, "text/css");
     }
     else
     {
         resp.Context.Response.Write(resp.Script, "text/css");
     }
 }
Beispiel #5
0
 public void Setup()
 {
     CssResponse           = new CssResponse(Http.Object, false);
     CompressedCssResponse = new CssResponse(Http.Object, true);
 }
Beispiel #6
0
 public void Setup()
 {
     CssResponse = new CssResponse(Http.Object);
 }
Beispiel #7
0
 public void Process(ISemanticProcessor proc, IMembrane membrane, CssResponse resp)
 {
     // resp.Context.Response.ContentLength64 = resp.Script.Length;
     resp.Context.Response.Write(resp.Script, "text/css");
 }
Beispiel #8
0
 public void Setup()
 {
     CssResponse = new CssResponse(Http.Object);
 }
Beispiel #9
0
 public void Process(ISemanticProcessor proc, IMembrane membrane, CssResponse resp)
 {
     byte[] utf8data = resp.Script.to_Utf8();
     resp.Context.Response.ContentType = "text/css";
     resp.Context.Response.ContentEncoding = Encoding.UTF8;
     resp.Context.Response.ContentLength64 = utf8data.Length;
     resp.Context.Response.OutputStream.Write(utf8data, 0, utf8data.Length);
     resp.Context.Response.Close();
 }