예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 public static void DescriptionReturnsValueSpecifiedInConstructor()
 {
     var value = new ValueDescriptor("DisplayName", "Description");
     Assert.Equal("Description", value.Description);
 }
예제 #4
0
 public static void DescriptionIsEmptyStringByDefault()
 {
     var value = new ValueDescriptor("DisplayName");
     Assert.Empty(value.Description);
 }
예제 #5
0
        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");
        }
예제 #6
0
        public static void DescriptionReturnsValueSpecifiedInConstructor()
        {
            var value = new ValueDescriptor("DisplayName", "Description");

            Assert.Equal("Description", value.Description);
        }
예제 #7
0
        public static void DescriptionIsEmptyStringByDefault()
        {
            var value = new ValueDescriptor("DisplayName");

            Assert.Empty(value.Description);
        }
 private static Completion CreateAttributeValueCompletion(ValueDescriptor value)
 {
     Debug.Assert(value != null, "value");
     return new Completion(value.DisplayName, value.DisplayName, value.Description, null, null);
 }