Exemplo n.º 1
0
        public void EncodingFixerExpectedExceptionTest()
        {
            byte[] bytes = new byte[] { 0xFF, 150 };
            string encodingFixedString = EncodingFixer.FixQuickBaseEncoding(bytes);

            Assert.AreEqual(encodingFixedString, "255–");
        }
Exemplo n.º 2
0
        public void EncodingFixerSuccessTest()
        {
            UTF8Encoding encoder = new UTF8Encoding();

            byte[] bytes = encoder.GetBytes("a");
            string encodingFixedString = EncodingFixer.FixQuickBaseEncoding(bytes);

            Assert.AreEqual(encodingFixedString, "a");
        }
Exemplo n.º 3
0
        /// <summary>
        /// Parses the response string to an XmlDocument object.
        /// </summary>
        /// <param name="response">The response string.</param>
        /// <returns>The XmlDocument object.</returns>
        public static XmlDocument ParseResponseIntoXml(string response)
        {
            UTF8Encoding encoder = new UTF8Encoding();
            XmlDocument  respXML = new XmlDocument();

            byte[] responseBytes     = encoder.GetBytes(response);
            string quickBaseResponse = EncodingFixer.FixQuickBaseEncoding(responseBytes);

            respXML.LoadXml(quickBaseResponse);
            return(respXML);
        }