public void AssignAssignsContactToUser() { Contact contact = CreateAndInsertContact(); SystemUser user = SystemUser.ReadByDomainname(_dynamicsCrmConnection, "KAD\\Svend"); Guid userId = user.Id; contact.owner = userId; bool assignResult = contact.Assign(); List <Contact> contacts = Contact.ReadFromFetchXml(_dynamicsCrmConnection, new List <string>() { "firstname", "ownerid" }, new Dictionary <string, string>() { { "contactid", contact.Id.ToString() } }); Contact readContact = contacts.Single(); Assert.IsTrue(assignResult); Assert.AreEqual(contact.firstname, readContact.firstname); Assert.AreEqual(userId, readContact.owner); contact.Delete(); }
public void UserCanBeRetreivedByDomainName() { string domainName = "KAD\\" + _urlLogin.Username; SystemUser user = SystemUser.ReadByDomainname(_dynamicsCrmConnection, domainName); Assert.IsNotNull(user); }