private void GeneratePropertyTest(int counter, int counter2, IPropertyName sut)
        {
            OpenTestAndDeclareSut(counter, counter2, sut);
            _sb.AppendAreEqual(sut.HasGetter, "sut.hasGetter()");
            _sb.AppendAreEqual(sut.HasSetter, "sut.hasSetter()");
            _sb.AppendAreEqual(sut.IsIndexer, "sut.isIndexer()");

            _sb.AppendParameterizedNameAssert(sut);
            _sb.CloseTest();
        }
        private static IPropertyName ToAnonymousName(IPropertyName property)
        {
            var identifier = new StringBuilder();

            identifier.AppendIf(property.HasSetter, PropertyName.SetterModifier + " ");
            identifier.AppendIf(property.HasGetter, PropertyName.GetterModifier + " ");
            identifier.AppendAnonymousMemberName(property, property.ValueType);
            var anonymize = property.DeclaringType.IsUnknown || property.DeclaringType.Assembly.IsLocalProject;

            identifier.AppendParameters(property.Parameters, anonymize);
            return(Names.Property(identifier.ToString()));
        }
示例#3
0
 protected static PropertyReference PropertyRef(IPropertyName propertyName, IVariableReference declTypeRef)
 {
     return(new PropertyReference {
         PropertyName = propertyName, Reference = declTypeRef
     });
 }
 /// <exception cref="W3c.Ddr.Exceptions.NameException">Thrown when...</exception>
 public IPropertyRef NewPropertyRef(IPropertyName pn)
 {
     VocabularyProperty vocabularyProperty = vocabularyHolder.ExistProperty(pn.LocalPropertyName(), null, pn.Namespace(), true);
     return NewPropertyRef(pn, vocabularyProperty.defaultAspect);
 }
 /// <exception cref="W3c.Ddr.Exceptions.NameException">Thrown when...</exception>
 public IPropertyRef NewPropertyRef(IPropertyName pn, string localAspectName)
 {
     vocabularyHolder.ExistProperty(pn.LocalPropertyName(), localAspectName, pn.Namespace(), true);
     return new ODDRPropertyRef(pn, localAspectName);
 }
 /// <exception cref="W3c.Ddr.Exceptions.NameException">Thrown when...</exception>
 public IPropertyValue GetPropertyValue(IEvidence evdnc, IPropertyName pn)
 {
     return GetPropertyValue(evdnc, NewPropertyRef(pn));
 }
 public ODDRPropertyRef(IPropertyName propertyName, String aspectName)
 {
     this.propertyName = propertyName;
     this.aspectName = aspectName;
 }
示例#8
0
 public static IPropertyName RemoveGenerics(this IPropertyName name)
 {
     return(new PropertyName(RemoveGenerics(name.Identifier)));
 }