예제 #1
0
        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);
        }
예제 #2
0
        public void AddPropertyCodenameConstant_PropertyIsAdded()
        {
            var elementCodename = "element_codename";

            var classDefinition = new ClassDefinition("Class name");

            classDefinition.AddPropertyCodenameConstant(elementCodename);

            Assert.Single(classDefinition.PropertyCodenameConstants, property => property == elementCodename);
        }
예제 #3
0
 protected static void AddProperty(Property property, ref ClassDefinition classDefinition)
 {
     classDefinition.AddPropertyCodenameConstant(property.Codename);
     classDefinition.AddProperty(property);
 }