public void GetIdAliasKey()
        {
            string entityName    = "contactIdAliasKey";
            string attributeName = "contactIdAliasKeyid";

            var attributeMetaDataItem = new AttributeMetadata {
                LogicalName = attributeName
            };

            SetFieldValue(attributeMetaDataItem, "_attributeType", AttributeTypeCode.Uniqueidentifier);

            var attributes = new List <AttributeMetadata> {
                attributeMetaDataItem
            };

            var oneToManyRelationshipMetadata = new OneToManyRelationshipMetadata
            {
                ReferencingAttribute = attributeName
            };
            var oneToManyRelationships = new List <OneToManyRelationshipMetadata>
            {
                oneToManyRelationshipMetadata
            };

            var entityMetaData = InitializeEntityMetadata(attributes, oneToManyRelationships);

            SetFieldValue(entityMetaData, "_primaryIdAttribute", attributeName);

            var response = InjectMetaDataToResponse(new RetrieveEntityResponse(), entityMetaData);

            MockOrganizationService.Setup(a => a.Execute(It.IsAny <OrganizationRequest>())).Returns(response);

            string actual = null;

            FluentActions.Invoking(() => actual = systemUnderTest.GetIdAliasKey(entityName))
            .Should()
            .NotThrow();

            MockOrganizationService.VerifyAll();
            actual.Should().NotBeNullOrEmpty();
        }
示例#2
0
 public void GetIdAliasKey()
 {
     FluentActions.Invoking(() => systemUnderTest.GetIdAliasKey(entityName))
     .Should()
     .NotThrow();
 }