Quantcast
Channel: BizTalk Server General Forum
Viewing all articles
Browse latest Browse all 872

Unit test for XLangMessage

$
0
0

Hi

I want to test my function which takes a parameterXLangMessage.
the function returns th econtext 'ABC' of a message.
Here is the code of my function that i want to test

           public static String TransfererContexteFichier(XLANGMessage Xmsg_Fichier)
            {
                String str_ContexteABC = null;

                try
                {
                   
                    XDocument xDoc;
                    Stream originalStream = (Stream)Xmsg_Fichier[0].RetrieveAs(typeof(Stream));

                    using (XmlReader reader = XmlReader.Create(originalStream))
                    {
                        reader.MoveToContent();
                        xDoc = XDocument.Load(reader);
                    }

                       XElement ElementABC = xDoc.Element("ContexteABC");
                       str_ContexteABC= ElementABC.ToString();
                }
                catch (Exception)
                {
                    throw;
                }

                return str_ContexteABC;
            }

you have an ideahow to createautomated teststo test myfunction
thank you

Viewing all articles
Browse latest Browse all 872

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>