PageRenderTime 68ms CodeModel.GetById 22ms RepoModel.GetById 2ms app.codeStats 0ms

/sipsorcery-core/Tests/SIPSorcery.SIP.Core.UnitTests/SIPUserFieldUnitTest.cs

https://github.com/thecc4re/sipsorcery-mono
C# | 64 lines | 37 code | 8 blank | 19 comment | 2 complexity | 23d5224484fbd542d7bc338882af2d1c MD5 | raw file
Possible License(s): CC-BY-SA-3.0
  1. using System;
  2. using System.Text;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using Microsoft.VisualStudio.TestTools.UnitTesting;
  6. namespace SIPSorcery.SIP.Core.UnitTests
  7. {
  8. [TestClass]
  9. public class SIPUserFieldUnitTest
  10. {
  11. public SIPUserFieldUnitTest()
  12. { }
  13. private TestContext testContextInstance;
  14. public TestContext TestContext
  15. {
  16. get
  17. {
  18. return testContextInstance;
  19. }
  20. set
  21. {
  22. testContextInstance = value;
  23. }
  24. }
  25. #region Additional test attributes
  26. //
  27. // You can use the following additional attributes as you write your tests:
  28. //
  29. // Use ClassInitialize to run code before running the first test in the class
  30. // [ClassInitialize()]
  31. // public static void MyClassInitialize(TestContext testContext) { }
  32. //
  33. // Use ClassCleanup to run code after all tests in a class have run
  34. // [ClassCleanup()]
  35. // public static void MyClassCleanup() { }
  36. //
  37. // Use TestInitialize to run code before running each test
  38. // [TestInitialize()]
  39. // public void MyTestInitialize() { }
  40. //
  41. // Use TestCleanup to run code after each test has run
  42. // [TestCleanup()]
  43. // public void MyTestCleanup() { }
  44. //
  45. #endregion
  46. [TestMethod]
  47. public void ParamsInUserPortionURITest()
  48. {
  49. Console.WriteLine("--> " + System.Reflection.MethodBase.GetCurrentMethod().Name);
  50. SIPUserField userField = SIPUserField.ParseSIPUserField("<sip:C=on;t=DLPAN@10.0.0.1:5060;lr>");
  51. Assert.IsTrue("C=on;t=DLPAN" == userField.URI.User, "SIP user portion parsed incorrectly.");
  52. Assert.IsTrue("10.0.0.1:5060" == userField.URI.Host, "SIP host portion parsed incorrectly.");
  53. Console.WriteLine("-----------------------------------------");
  54. }
  55. }
  56. }