public void ValidateUsageWithContainerType_ContainerTypeWithTwoPropertiesWithArgumentsAttribute_ThrowsInvalidOperationException() { Type containerType = typeof(ContainerWithTwoArgumentsAttributeProperties); var attr = new ArgumentsAttribute(); Assert.Throws <InvalidOperationException>(() => attr.ValidateUsage(containerType)); }
public void ValidateUsageWithContainerType_ContainerTypeWithOnePropertyWithArgumentsAttribute_ValidatesOK() { Type containerType = typeof(ContainerWithOneArgumentsAttributeProperty); var attr = new ArgumentsAttribute(); attr.ValidateUsage(containerType); }
public void ValidateUsageWithPropertyInfo_PropertyWithArgumentsAttributeOnStringCollectionProperty_ValidatesOK() { PropertyInfo property = typeof(ContainerWithStringCollectionArgumentsProperty).GetProperty("Arguments"); var attr = new ArgumentsAttribute(); attr.ValidateUsage(property); }
public void ValidateUsageWithPropertyInfo_PropertyWithoutArgumentsAttribute_ThrowsInvalidOperationException() { PropertyInfo property = typeof(ContainerWithPropertyWithoutArgumentsAttribute).GetProperty("Arguments1"); var attr = new ArgumentsAttribute(); Assert.Throws <InvalidOperationException>(() => attr.ValidateUsage(property)); }
public void ValidateUsageWithPropertyInfo_PropertyWithArgumentsAttributeButNotACollection_ThrowsInvalidOperationException() { PropertyInfo property = typeof(ContainerWithNonCollectionArgumentsProperty).GetProperty("Arguments"); var attr = new ArgumentsAttribute(); Assert.Throws <InvalidOperationException>(() => attr.ValidateUsage(property)); }