public void GivenAttributeWithTabPropertySetToTypeNotInheritingFromTab_ValidatePageTypeAttributeTabProperty_ThrowsException() { PropertyInfo propertyInfo = typeof(TestPageType).GetProperty("PropertyWithTabSetToTypeNotInheritingFromTab"); PageTypePropertyAttribute attribute = propertyInfo.GetCustomAttributes <PageTypePropertyAttribute>().First(); PageTypeDefinitionPropertiesValidator propertiesValidator = new PageTypeDefinitionPropertiesValidator(null); Exception exception = Record.Exception(() => { propertiesValidator.ValidatePageTypeAttributeTabProperty(propertyInfo, attribute); }); Assert.NotNull(exception); }
public void GivenAttributeWithTabPropertyNotSet_ValidatePageTypeAttributeTabProperty_DoesNotThrowException() { PropertyInfo propertyInfo = typeof(TestPageType).GetProperty("StringTestProperty"); PageTypePropertyAttribute attribute = propertyInfo.GetCustomAttributes <PageTypePropertyAttribute>().First(); PageTypeDefinitionPropertiesValidator propertiesValidator = new PageTypeDefinitionPropertiesValidator(null); Exception exception = Record.Exception(() => { propertiesValidator.ValidatePageTypeAttributeTabProperty(propertyInfo, attribute); }); Assert.Null(exception); }