示例#1
0
 public override string ToString()
 {
     if (string.IsNullOrEmpty(_compressedHtml))
     {
         var html       = base.ToString();
         var compressor = new SimpleHtmlCompressor();
         _compressedHtml = compressor.Compress(html);
     }
     return(_compressedHtml);
 }
 public override string ToString()
 {
     if (string.IsNullOrEmpty(_compressedHtml))
     {
         var html = base.ToString();
         var compressor = new SimpleHtmlCompressor();
         _compressedHtml = compressor.Compress(html);
     }
     return _compressedHtml;
 }
示例#3
0
        [TestMethod]
        public void TestRemoveComment_Multispaces_CompressJs()
        {
            SimpleHtmlCompressor compressor = new SimpleHtmlCompressor() { IsCompressJs = true };

            Stopwatch stopwatch = new Stopwatch();
            stopwatch.Start();
            var actual = compressor.Compress(html);
            stopwatch.Stop();
            Console.WriteLine(stopwatch.ElapsedMilliseconds);
示例#4
0
        [TestMethod]
        public void TestRemoveComment_Multispaces()
        {
            SimpleHtmlCompressor compressor = new SimpleHtmlCompressor();

            Stopwatch stopwatch = new Stopwatch();
            stopwatch.Start();
            var actual = compressor.Compress(html);
            stopwatch.Stop();

            Console.WriteLine(stopwatch.ElapsedMilliseconds);

               Console.WriteLine(actual);

            //Assert.AreEqual(expected, actual);