Пример #1
0
        public void GetExportFetchXmlNonPrimaryKey()
        {
            var entityName = "account";
            var crmField   = new CrmField()
            {
                LookupType = entityName,
                FieldName  = "name"
            };

            var list = new Dictionary <string, List <string> >
            {
                { "name", new List <string> {
                      "testname"
                  } }
            };
            var lookupMappings = new Dictionary <string, Dictionary <string, List <string> > >
            {
                { entityName, list }
            };

            systemUnderTest = new MappingAliasedValueFetchCreator(lookupMappings);

            var actual = systemUnderTest.GetExportFetchXML(entityName, crmField);

            actual.Should().NotBeEmpty();
        }
Пример #2
0
        public void UseForEntity()
        {
            Dictionary <string, Dictionary <string, List <string> > > lookupMappings = new Dictionary <string, Dictionary <string, List <string> > >();

            systemUnderTest = new MappingAliasedValueFetchCreator(lookupMappings);

            var actual = systemUnderTest.UseForEntity("TestEntity");

            actual.Should().Be(false);
        }
Пример #3
0
        public void GetExportFetchXmlEmptyMappings()
        {
            var crmField = new CrmField()
            {
                LookupType = "account",
                FieldName  = "contacaccount"
            };

            Dictionary <string, Dictionary <string, List <string> > > lookupMappings = new Dictionary <string, Dictionary <string, List <string> > >();

            systemUnderTest = new MappingAliasedValueFetchCreator(lookupMappings);

            var actual = systemUnderTest.GetExportFetchXML("contact", crmField);

            actual.Should().BeEmpty();
        }
Пример #4
0
        public void GetExportFetchXmlNullMappings()
        {
            var crmField = new CrmField()
            {
                LookupType = "account",
                FieldName  = "contacaccount"
            };

            Dictionary <string, Dictionary <string, List <string> > > lookupMappings = null;

            systemUnderTest = new MappingAliasedValueFetchCreator(lookupMappings);

            FluentActions.Invoking(() => systemUnderTest.GetExportFetchXML("contact", crmField))
            .Should()
            .Throw <NullReferenceException>();
        }