Пример #1
0
        public void TestToStringWithEncodingReadFromHeader()
        {
            var encoding = Encoding.GetEncoding(936);

            var response = new HttpResponse
            {
                Bytes = new byte[]
                {
                    0x30,
                    0x00,
                    0xA6,
                    0xE2,
                    0xB2,
                    0xDF,
                    0xA6,
                    0xF5
                },
                Headers = new Dictionary <string, string>
                {
                    { "Content-Type", "charset=" + encoding.HeaderName }
                }
            };

            Assert.AreEqual("0\0︹策︴", response.ToString());
        }
Пример #2
0
        public void TestToStringWithEncodingReadFromHeader()
        {
            var encoding = Encoding.GetEncoding(936);

            var response = new HttpResponse
            {
                Bytes = new byte[]
                                               {
                                                   0x30,
                                                   0x00,
                                                   0xA6,
                                                   0xE2,
                                                   0xB2,
                                                   0xDF,
                                                   0xA6,
                                                   0xF5
                                               },
                Headers = new Dictionary<string, string>
                          {
                              {"Content-Type", "charset=" + encoding.HeaderName}
                          }
            };

            Assert.AreEqual("0\0︹策︴", response.ToString());
        }
Пример #3
0
        public void TestToStringWithEncoding()
        {
            var response = new HttpResponse
            {
                Bytes = new byte[]
                {
                    0x30,
                    0x00,
                    0xA6,
                    0xE2,
                    0xB2,
                    0xDF,
                    0xA6,
                    0xF5
                }
            };

            Assert.AreEqual("0\0︹策︴", response.ToString(Encoding.GetEncoding(936)));
        }
Пример #4
0
        public void TestToStringWithEncoding()
        {
            var response = new HttpResponse
                               {
                                   Bytes = new byte[]
                                               {
                                                   0x30,
                                                   0x00,
                                                   0xA6,
                                                   0xE2,
                                                   0xB2,
                                                   0xDF,
                                                   0xA6,
                                                   0xF5
                                               }
                               };

            Assert.AreEqual("0\0︹策︴", response.ToString(Encoding.GetEncoding(936)));
        }
Пример #5
0
        public void TestToStringOnEmptyRepsonse()
        {
            var response = new HttpResponse();

            Assert.AreEqual(string.Empty, response.ToString());
        }
Пример #6
0
        public void TestToStringOnEmptyRepsonse()
        {
            var response = new HttpResponse();

            Assert.AreEqual(string.Empty, response.ToString());
        }