예제 #1
0
        public void TestDecompressPhpGeneratedData()
        {
            var data    = "H4sIAAAAAAAAAyvJSFVIzUvOT8nMS1dILChILErMK8mpVCjPL8pOTQEAw6AGlB4AAAA=";
            var decoded = GzipCompressionHandler.DecodeBase64AndDecompress(data);

            decoded.Should().Be.EqualTo("the encoding apparantly worked");
        }
예제 #2
0
        public void TestCompression()
        {
            foreach (var lorum in lorums)
            {
                var e = GzipCompressionHandler.CompressAndConvertToBase64(lorum);
                var d = GzipCompressionHandler.DecodeBase64AndDecompress(e);

                Debug.Assert(d.Equals(lorum));
            }
        }
예제 #3
0
        //[TestMethod]
        public void TestDecompressPhpGeneratedData123()
        {
            foreach (var data in lorums)
            {
                var urlEncoded = HttpUtility.UrlEncode(data);
                using (WebClient client = new WebClient()) {
                    var url    = UrlBuddyServer + "/test_encode_with_data?data=" + urlEncoded;
                    var result = client.DownloadString(url);

                    var decoded = GzipCompressionHandler.DecodeBase64AndDecompress(result);
                    decoded.Should().Be.EqualTo(data);
                }
            }
        }