SIPSorcery.SIP.SIPEventDialogInfo.SIPDialogEventInfoUnitTest.ParseFromXMLStringUnitTest C# (CSharp) Method

ParseFromXMLStringUnitTest() private method

private ParseFromXMLStringUnitTest ( ) : void
return void
            public void ParseFromXMLStringUnitTest()
            {
                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-info>";

                SIPEventDialogInfo dialogInfo = SIPEventDialogInfo.Parse(eventDialogInfoStr);

                Assert.IsTrue(dialogInfo.Version == 1, "The parsed event dialog version was incorrect.");
                Assert.IsTrue(dialogInfo.State == SIPEventDialogInfoStateEnum.full, "The parsed event dialog state was incorrect.");
                Assert.IsTrue(dialogInfo.Entity == SIPURI.ParseSIPURI("sip:[email protected]"), "The parsed event dialog entity was incorrect.");
                Assert.IsTrue(dialogInfo.DialogItems.Count == 1, "The parsed event dialog items count was incorrect.");
                Assert.IsTrue(dialogInfo.DialogItems[0].ID == "as7d900as8", "The parsed event dialog event id was incorrect.");
                Assert.IsTrue(dialogInfo.DialogItems[0].CallID == "a84b4c76e66710", "The parsed event dialog event call-id was incorrect.");
                Assert.IsTrue(dialogInfo.DialogItems[0].LocalTag == "1928301774", "The parsed event dialog event local-tag was incorrect.");
                Assert.IsTrue(dialogInfo.DialogItems[0].Direction == SIPEventDialogDirectionEnum.initiator, "The parsed event dialog event direction was incorrect.");
                Assert.IsTrue(dialogInfo.DialogItems[0].State == "terminated", "The parsed event dialog event state was incorrect.");
                Assert.IsTrue(dialogInfo.DialogItems[0].StateEvent == SIPEventDialogStateEvent.RemoteBye, "The parsed event dialog event state event was incorrect.");
                Assert.IsTrue(dialogInfo.DialogItems[0].StateCode == 486, "The parsed event dialog event state code was incorrect.");
                Assert.IsTrue(dialogInfo.DialogItems[0].Duration == 13, "The parsed event dialog event duration was incorrect.");

                Console.WriteLine("-----------------------------------------");
            }