Beispiel #1
0
        public void Shall_clone_header()
        {
            NameAddressHeader original = NameAddressHeader.Parse("Mr President <sip:[email protected]>");
            NameAddressHeader cloned   = original.DeepClone();

            original.DisplayName = "Barack Obama";
            original.Url         = SipUri.Parse("sip:[email protected]");
            original.Parameters.Add(new GenericParameter("foo", "bar"));

            Assert.That(cloned.ToString(), Is.EqualTo("Mr President <sip:[email protected]>"));
            Assert.That(original.ToString(), Is.EqualTo("Barack Obama <sip:[email protected]>;foo=bar"));
        }
Beispiel #2
0
        public void Shall_stringify_header()
        {
            var header = new NameAddressHeader
            {
                DisplayName = "Mr President",
                Url         = SipUri.Parse("sip:[email protected]"),
                Parameters  =
                {
                    new GenericParameter("foo", "bar")
                }
            };

            Assert.That(
                header.ToString(),
                Is.EqualTo("Mr President <sip:[email protected]>;foo=bar"));
        }