public void Should_Pass_ExcpectedResults()
        {
            string expected = "{\"foo\":\"bar\"}";
            string result   = SerializeXML.XmlToJson("<foo>bar</foo>");

            Assert.AreEqual(expected, result);
        }
Beispiel #2
0
        public string XmlToJson(string xml)
        {
            log.Info(String.Format("In : XmlToJson : xml = {0}", xml));
            // Uncomment for the WaitingForm test
            //Thread.Sleep(2000);
            string result = String.Empty;

            try
            {
                result = SerializeXML.XmlToJson(xml);
            }
            catch (Exception ex)
            {
                log.Error("Exception : XmlToJson : " + ex.Message);
                return("Bad Xml format");
            }
            finally
            {
                log.Info("Out : XmlToJson");
            }

            return(result);
        }
 public void Should_Pass_ExpectedExceptionIsRaised()
 {
     SerializeXML.XmlToJson(String.Empty);
 }
 public void Should_Pass_BadXMLFormatReturnedExpected()
 {
     SerializeXML.XmlToJson("<foo>hello</bar>");
 }