コード例 #1
0
        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));
            }
        }
コード例 #2
0
        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));
            }
        }
コード例 #3
0
        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));
            }
        }
コード例 #4
0
        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));
            }
        }
コード例 #5
0
        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));
            }
        }
コード例 #6
0
        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));
            }
        }
コード例 #7
0
        public override SipHeader Clone()
        {
            var p = new SipToHeaderParser();

            return(p.Parse(this.FormatBodyToString()));
        }