예제 #1
0
        public static void Shrink(string expected, string html)
        {
            // Arrange
            var buffer = Encoding.UTF8.GetBytes(html);

            // Act
            var length = ShrinkHelper2.Shrink(buffer, 0, buffer.Length);

            // Assert
            Assert.Equal(expected, Encoding.UTF8.GetString(buffer, 0, length));
        }
예제 #2
0
        public static void Shrink2(string html)
        {
            // Arrange

            // Act
            for (int i = 0; i < 100; i++)
            {
                var buffer = Encoding.UTF8.GetBytes(html.Repeat(1000));
                var length = ShrinkHelper2.Shrink(buffer, 0, buffer.Length);
            }

            // Assert
        }