public static void CultureProvidesMetadataAboutWellKnownValues() { var attributeDescriptor = new AttributeDescriptor(TypeDescriptor.GetProperties(typeof(TemplateDirective))["Culture"]); Assert.NotEqual(0, attributeDescriptor.Values.Count); ValueDescriptor valueDescriptor = attributeDescriptor.Values["en-US"]; Assert.Equal("English (United States)", valueDescriptor.Description); }
public static void EncodingProvidesMetadataAboutKnownValues() { var attributeDescriptor = new AttributeDescriptor(TypeDescriptor.GetProperties(typeof(OutputDirective))["Encoding"]); Assert.NotEqual(0, attributeDescriptor.Values.Count); ValueDescriptor valueDescriptor = attributeDescriptor.Values["utf-16"]; Assert.Equal("Unicode", valueDescriptor.Description); }
public static void DescriptionReturnsValueSpecifiedInConstructor() { var value = new ValueDescriptor("DisplayName", "Description"); Assert.Equal("Description", value.Description); }
public static void DescriptionIsEmptyStringByDefault() { var value = new ValueDescriptor("DisplayName"); Assert.Empty(value.Description); }
private static void VerifyAttributeValueDescriptor(AttributeDescriptor attribute, string valueName) { ValueDescriptor value = attribute.Values[valueName]; Assert.False(string.IsNullOrWhiteSpace(value.Description), valueName + " attribute value does not have a description"); }
private static Completion CreateAttributeValueCompletion(ValueDescriptor value) { Debug.Assert(value != null, "value"); return new Completion(value.DisplayName, value.DisplayName, value.Description, null, null); }