public void AddPropertyCodenameConstant_DuplicatePropertyCodenameConstant_Throws() { var elementCodename = "element_codename"; var classDefinition = new ClassDefinition("Class name"); classDefinition.AddPropertyCodenameConstant(elementCodename); Assert.Throws <InvalidOperationException>(() => classDefinition.AddPropertyCodenameConstant(elementCodename)); Assert.Single(classDefinition.PropertyCodenameConstants, property => property == elementCodename); }
public void AddPropertyCodenameConstant_PropertyIsAdded() { var elementCodename = "element_codename"; var classDefinition = new ClassDefinition("Class name"); classDefinition.AddPropertyCodenameConstant(elementCodename); Assert.Single(classDefinition.PropertyCodenameConstants, property => property == elementCodename); }
protected static void AddProperty(Property property, ref ClassDefinition classDefinition) { classDefinition.AddPropertyCodenameConstant(property.Codename); classDefinition.AddProperty(property); }