public void ParseFromXMLStringMultiDialogsUnitTest()
{
Console.WriteLine("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
string eventDialogInfoStr = "<?xml version='1.0' encoding='utf-16'?>" +
"<dialog-info version='1' state='full' entity='sip:[email protected]' xmlns='urn:ietf:params:xml:ns:dialog-info'>" +
" <dialog id='as7d900as8' call-id='a84b4c76e66710' local-tag='1928301774' direction='initiator'>" +
" <state event='remote-bye' code='486'>terminated</state>" +
" <duration>13</duration>" +
" </dialog>" +
" <dialog id='4353458'>" +
" <state>progressing</state>" +
" </dialog>" +
"</dialog-info>";
SIPEventDialogInfo dialogInfo = SIPEventDialogInfo.Parse(eventDialogInfoStr);
Assert.IsTrue(dialogInfo.DialogItems.Count == 2, "The parsed event dialog items count was incorrect.");
Assert.IsTrue(dialogInfo.DialogItems[0].ID == "as7d900as8", "The parsed event dialog event id for the first dialog was incorrect.");
Assert.IsTrue(dialogInfo.DialogItems[0].State == "terminated", "The parsed event dialog event state for the first dialog was incorrect.");
Assert.IsTrue(dialogInfo.DialogItems[1].ID == "4353458", "The parsed event dialog event id for the second dialog was incorrect.");
Assert.IsTrue(dialogInfo.DialogItems[1].State == "progressing", "The parsed event dialog event state for the second dialog was incorrect.");
Console.WriteLine(dialogInfo.ToXMLText());
Console.WriteLine("-----------------------------------------");
}