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(); }
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(); }
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>(); }