public void ExistsReturnsFalseWhenContactDoesNotExists() { Contact contact = CreateTestContact(); contact.emailaddress1 = $"email {Guid.NewGuid()}"; contact.firstname = $"firstname {Guid.NewGuid()}"; contact.Insert(); bool exists = StaticCrm.Exists <Contact>(_dynamicsCrmConnection, new Dictionary <string, string>() { { "emailaddress1", contact.emailaddress1 }, { "firstname", $"firstname {Guid.NewGuid()}" }, }); contact.Delete(); Assert.False(exists); }
private void CreateInsertedIntermediateEntity(string insertedEntityName, string insertedEntityIdName, string insertedEntityOriginIdName, dynamic insertedEntity) { string originEntityIdName = _databaseCopyNN.originEntityIdName; string targetName = _databaseCopyNN.targetName; string targetIdName = _databaseCopyNN.targetIdName; string intermediateEntityRelationshipName = _databaseCopyNN.intermediateEntityRelationshipName; IDictionary <string, object> insertedEntityDictionary = (IDictionary <string, object>)insertedEntity; Guid insertedEntityId = (Guid)insertedEntityDictionary[insertedEntityIdName]; Guid insertedEntityOriginId = StaticCrm.GetGuidFromReference(insertedEntityDictionary[insertedEntityOriginIdName]); List <dynamic> originIntermediateEntities = GetOriginIntermediateEntities(originEntityIdName, targetIdName, insertedEntityOriginId); foreach (dynamic originIntermediateEntity in originIntermediateEntities) { IDictionary <string, object> originIntermediateEntityDictionary = (IDictionary <string, object>)originIntermediateEntity; Guid targetId = (Guid)originIntermediateEntityDictionary[targetIdName]; StaticCrm.AssociateNN(_dynamicsCrmConnection, intermediateEntityRelationshipName, insertedEntityName, insertedEntityId, targetName, targetId); } }
public void GetAllAttributeNames() { List <string> attributeNames = StaticCrm.GetAllAttributeNames(_dynamicsCrmConnection, typeof(Annotation)); Assert.Greater(attributeNames.Count, 3); }