public void EnumDataTypeAttribute_NotEnum() { EnumDataTypeAttribute target = new EnumDataTypeAttribute(typeof(string)); ExceptionHelper.ExpectInvalidOperationException(delegate() { target.IsValid("any value"); }, String.Format(CultureInfo.CurrentCulture, Resources.DataAnnotationsResources.EnumDataTypeAttribute_TypeNeedsToBeAnEnum, typeof(string).FullName)); }
public void EnumDataTypeAttribute_Null() { EnumDataTypeAttribute target = new EnumDataTypeAttribute(null); ExceptionHelper.ExpectInvalidOperationException(delegate() { target.IsValid("any value"); }, Resources.DataAnnotationsResources.EnumDataTypeAttribute_TypeCannotBeNull); }