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); }
public void HasAttributeGeneric_Success() { // Arrange & Act & Assert var attribute = TypeAssert.HasAttribute <FakeClassModel, FakeClassAttribute>(); Assert.NotNull(attribute); Assert.IsAssignableFrom <FakeClassAttribute>(attribute); }
public void HasAttribute_Success() { // Arrange & Act & Assert var typeInfo = TypeAssert.HasAttribute <FakeClassModel>(typeof(FakeClassAttribute)); Assert.NotNull(typeInfo); Assert.IsAssignableFrom <TypeInfo>(typeInfo); }
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); }