Example #1
0
        [Test] public void NoOriginalName()
        {
            IResource contactName = CreateContactName(_contact, "Dmitry Jemerov (JetBrains)");

            _email.AddLink(_contactManager.Props.LinkFrom, _contact);
            _email.AddLink(Core.ContactManager.Props.LinkNameFrom, contactName);
            Assert.AreEqual("Dmitry Jemerov", ContactsPlugin.SubstituteName(_email, _contactManager.Props.LinkFrom));
        }
Example #2
0
        [Test] public void NoContact()
        {
            _storage.ResourceTypes.Register("Weblog", "Name");
            IResource weblog = _storage.NewResource("Weblog");

            weblog.SetProp("Name", "yole's devblog");
            _email.AddLink(_contactManager.Props.LinkFrom, weblog);
            Assert.AreEqual("yole's devblog", ContactsPlugin.SubstituteName(_email, _contactManager.Props.LinkFrom));
        }
Example #3
0
        [Test] public void MultipleNames()
        {
            IResource contactName  = CreateContactName(_contact, "Dmitry Jemerov (JetBrains)");
            IResource contactName2 = CreateContactName(_contact2, "Michael Gerasimov (JetBrains)");

            _contact.SetProp(Core.ContactManager.Props.ShowOriginalNames, true);
            _email.AddLink(_contactManager.Props.LinkFrom, _contact);
            _email.AddLink(Core.ContactManager.Props.LinkNameFrom, contactName);
            _email.AddLink(_contactManager.Props.LinkFrom, _contact2);
            _email.AddLink(Core.ContactManager.Props.LinkNameFrom, contactName2);
            Assert.AreEqual("Dmitry Jemerov (JetBrains), Michael Gerasimov",
                            ContactsPlugin.SubstituteName(_email, _contactManager.Props.LinkFrom));
        }
Example #4
0
 [Test] public void NoContactName()
 {
     _email.AddLink(_contactManager.Props.LinkFrom, _contact);
     Assert.AreEqual("Dmitry Jemerov", ContactsPlugin.SubstituteName(_email, _contactManager.Props.LinkFrom));
 }