public void Parse_ToUriDoesNotHavePortSpecified_ExpectToUseDefaultPort5060() { String[] strings = { "To: <sip:1.1.1.1>", }; for (int i = 0; i < strings.Length; i++) { var p = new SipToHeaderParser(); var result = p.Parse(strings[i]); Assert.AreEqual(strings[i], SipFormatter.FormatHeader(result)); } }
public void Parse_DoesNotStartWithLAQOUT_ExpectThrowException() { String[] strings = { "To: sip:1.1.1.1:222>", }; for (int i = 0; i < strings.Length; i++) { var p = new SipToHeaderParser(); var result = p.Parse(strings[i]); Assert.AreEqual(strings[i], SipFormatter.FormatHeader(result)); } }
public void Parse_ValidFormat_ExpectEqualFormatAfterParsing() { String[] strings = { "To: <sip:[email protected]>", "To: <sip:[email protected]>;tag=1111" }; for (int i = 0; i < strings.Length; i++) { var p = new SipToHeaderParser(); var result = p.Parse(strings[i]); Assert.AreEqual(strings[i], SipFormatter.FormatHeader(result)); } }
public override SipHeader Clone() { var p = new SipToHeaderParser(); return(p.Parse(this.FormatBodyToString())); }