예제 #1
0
        public void XmlRootAttribute_Defined()
        {
            // Arrange & Act & Assert
            var attribute = TypeAssert.HasAttribute <Resx, XmlRootAttribute>();

            Assert.Equal("root", attribute.ElementName);
        }
        public void Attribute_Defined(Type attributeType, string firstAttributePropertyName, object firstAttributePropertyValue, string secondAttributePropertyName, object secondAttributePropertyValue)
        {
            // Arrange & Act & Assert
            var typeInfo = TypeAssert.HasAttribute <DescriptionTagHelper>(attributeType);

            AttributeAssert.ValidateProperty(typeInfo, attributeType, firstAttributePropertyName, firstAttributePropertyValue);
            AttributeAssert.ValidateProperty(typeInfo, attributeType, secondAttributePropertyName, secondAttributePropertyValue);
        }
예제 #3
0
        public void HasAttributeGeneric_Success()
        {
            // Arrange & Act & Assert
            var attribute = TypeAssert.HasAttribute <FakeClassModel, FakeClassAttribute>();

            Assert.NotNull(attribute);
            Assert.IsAssignableFrom <FakeClassAttribute>(attribute);
        }
예제 #4
0
        public void HasAttribute_Success()
        {
            // Arrange & Act & Assert
            var typeInfo = TypeAssert.HasAttribute <FakeClassModel>(typeof(FakeClassAttribute));

            Assert.NotNull(typeInfo);
            Assert.IsAssignableFrom <TypeInfo>(typeInfo);
        }
예제 #5
0
 public void HasAttribute_ThrowsTrueExceptionIfNoAttribute()
 {
     // Arrange & Act & Assert
     Assert.Throws <TrueException>(
         () => TypeAssert.HasAttribute <FakeClassModel>(
             typeof(FakePropertyAttribute)
             )
         );
 }
 public void Attribute_Defined(Type attributeType)
 {
     // Arrange & Act & Assert
     TypeAssert.HasAttribute <HomeController>(attributeType);
 }