Пример #1
0
 private static IElement NewElement(IElementContainer parent, IPatternElementInfo info, string name)
 {
     return(parent.CreateElement(e =>
     {
         e.DefinitionId = info.Id;
         e.InstanceName = name;
     }));
 }
        private static Element CreateElement(IElementContainer parent, string elementName, Cardinality cardinality)
        {
            var child = (Element)parent.CreateElement();
            var elementInstanceCount = parent.Elements.Where(e => e.DefinitionName == elementName).Count() + 1;

            child.DefinitionName = elementName;
            child.InstanceName   = elementName + elementInstanceCount.ToString();
            child.Info           = Mock.Of <IElementInfo>(ei => ei.Name == elementName && ei.CodeIdentifier == elementName && ei.Cardinality == cardinality);

            var property = CreateProperty(child, elementName + "Property1", elementName + "Value1");

            return(child);
        }
        private static Element CreateElement(IElementContainer parent, string elementName, Cardinality cardinality)
        {
            var child = (Element)parent.CreateElement();
            var elementInstanceCount = parent.Elements.Where(e => e.DefinitionName == elementName).Count() + 1;

            child.DefinitionName = elementName;
            child.InstanceName = elementName + elementInstanceCount.ToString();
            child.Info = Mock.Of<IElementInfo>(ei => ei.Name == elementName && ei.CodeIdentifier == elementName && ei.Cardinality == cardinality);

            var property = CreateProperty(child, elementName + "Property1", elementName + "Value1");

            return child;
        }