/sipsorcery-core/Tests/SIPSorcery.SIP.Core.UnitTests/SIPUserFieldUnitTest.cs
C# | 64 lines | 37 code | 8 blank | 19 comment | 2 complexity | 23d5224484fbd542d7bc338882af2d1c MD5 | raw file
Possible License(s): CC-BY-SA-3.0
- using System;
- using System.Text;
- using System.Collections.Generic;
- using System.Linq;
- using Microsoft.VisualStudio.TestTools.UnitTesting;
-
- namespace SIPSorcery.SIP.Core.UnitTests
- {
- [TestClass]
- public class SIPUserFieldUnitTest
- {
- public SIPUserFieldUnitTest()
- { }
-
- private TestContext testContextInstance;
-
- public TestContext TestContext
- {
- get
- {
- return testContextInstance;
- }
- set
- {
- testContextInstance = value;
- }
- }
-
- #region Additional test attributes
- //
- // You can use the following additional attributes as you write your tests:
- //
- // Use ClassInitialize to run code before running the first test in the class
- // [ClassInitialize()]
- // public static void MyClassInitialize(TestContext testContext) { }
- //
- // Use ClassCleanup to run code after all tests in a class have run
- // [ClassCleanup()]
- // public static void MyClassCleanup() { }
- //
- // Use TestInitialize to run code before running each test
- // [TestInitialize()]
- // public void MyTestInitialize() { }
- //
- // Use TestCleanup to run code after each test has run
- // [TestCleanup()]
- // public void MyTestCleanup() { }
- //
- #endregion
-
- [TestMethod]
- public void ParamsInUserPortionURITest()
- {
- Console.WriteLine("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
-
- SIPUserField userField = SIPUserField.ParseSIPUserField("<sip:C=on;t=DLPAN@10.0.0.1:5060;lr>");
-
- Assert.IsTrue("C=on;t=DLPAN" == userField.URI.User, "SIP user portion parsed incorrectly.");
- Assert.IsTrue("10.0.0.1:5060" == userField.URI.Host, "SIP host portion parsed incorrectly.");
-
- Console.WriteLine("-----------------------------------------");
- }
- }
- }