private void AssertPredefinedConfigurationsMap(PredefinedMap predefinedMap, string[] collectionNames, Type modelType, PropertyInfo[] propertyInfos) { var modelTypeName = predefinedMap.ModelTypeName(); modelType.Name.ShouldBe(modelTypeName); propertyInfos.Length.ShouldBeGreaterThan(15); if (new[] { PredefinedMap.ASPxLookupDropDownEdit, PredefinedMap.ASPxLookupFindEdit, }.All(map => map != predefinedMap)) { var descriptionAttribute = propertyInfos.Select(info => info.Attribute <DescriptionAttribute>()) .FirstOrDefault(attribute => attribute != null && attribute.Description.Contains(" ")); descriptionAttribute.ShouldNotBeNull(); foreach (var collectionName in collectionNames) { propertyInfos.FirstOrDefault(info => info.Name == collectionName).ShouldNotBeNull(); } } }
public void ExtendModel_PredefinedChartDiagram(PredefinedMap configuration, Type typeToMap, string platformName) { var platform = GetPlatform(platformName); InitializeMapperService($"{nameof(ExtendModel_PredefinedChartDiagram)}{configuration}{platform}", platform); using (var module = PredefinedMap.ChartControl.Extend()){ configuration.Extend(module); using (var application = DefaultModelMapperModule(nameof(ExtendModel_PredefinedChartDiagram), platform, module).Application){ var modelListView = application.Model.Views.OfType <IModelListView>().First(); var modelNode = modelListView.GetNode(PredefinedMap.ChartControl); modelNode = modelNode.GetNode("Diagrams"); var diagramType = modelNode.ModelListItemType(); var targetType = diagramType.Assembly.GetType(configuration.ModelTypeName()); diagramType.IsAssignableFrom(targetType).ShouldBeTrue(); } } }