public void CombineValidationTextNoneReturnsNone() { ValidationText vt = ValidationText.Create(new[] { ValidationText.None, ValidationText.None }); Assert.Same(ValidationText.None, vt); }
/// <summary> /// Text(验证) /// </summary> /// <param name="id">id/name</param> /// <param name="size">大小</param> /// <param name="validation">验证类型</param> /// <param name="tip">提示</param> /// <param name="description">描述</param> /// <returns></returns> public static IHtmlString TextKeyUp(string id, TextSize size, ValidationText validation, string tip = "", string description = "") { return new HtmlString(string.Format("<input type=\"text\" class=\"{1} {2}\" id=\"{0}\" name=\"{0}\"/>", id, size, validation.ToString())).AddTitle(tip, description); }
public void CreateSingleStringEmptyReturnsEmpty() { ValidationText vt = ValidationText.Create((IEnumerable <string>) new[] { string.Empty }); Assert.Same(ValidationText.Empty, vt); }
public void CreateValidationTextEmptyReturnsEmpty() { ValidationText vt = ValidationText.Create(new[] { ValidationText.Empty }); Assert.Same(ValidationText.Empty, vt); }
public void CreateNoneItemStringEnumerableReturnsNone() { ValidationText vt = ValidationText.Create(ValidationText.None); Assert.Same(ValidationText.None, vt); }
public void CreateStringEmptyReturnsEmpty() { ValidationText vt = ValidationText.Create(string.Empty); Assert.Same(ValidationText.Empty, vt); }
public void CreateNullItemStringEnumerableReturnsNone() { ValidationText vt = ValidationText.Create((IEnumerable <string>) new string[] { null }); Assert.Same(ValidationText.None, vt); }
public void CreateNoneItemValidationTextEnumerableReturnsNone() { ValidationText vt = ValidationText.Create(new[] { ValidationText.None }); Assert.Same(ValidationText.None, vt); }
public SRPValidation(ValidationText validationText, ValidationEmail validationEmail, ValidationNumber validationNumber) { _validationText = validationText; _validationEmail = validationEmail; _validationNumber = validationNumber; }
public void CreateNullValidationTextEnumerableReturnsNone() { ValidationText vt = ValidationText.Create((IEnumerable <ValidationText>)null); Assert.Same(ValidationText.None, vt); }
/// <summary> /// Initializes a new instance of the <see cref="ValidationState"/> class. /// </summary> /// <param name="isValid">Determines if the property is valid or not.</param> /// <param name="text">Validation text.</param> /// <param name="component">Validation property.</param> public ValidationState(bool isValid, ValidationText text, IValidationComponent component) { IsValid = isValid; Text = text; Component = component; }
/// <summary> /// Formats the <see cref="ValidationText"/> into a single line text using the /// default separator. /// </summary> /// <param name="validationText">ValidationText object to be formatted.</param> /// <returns>Returns the string formatted.</returns> public string Format(ValidationText validationText) { return(validationText != null ? validationText.ToSingleLine(_separator) : string.Empty); }
private void UserName_KeyPress(object sender, KeyPressEventArgs e) { ValidationText log = new ValidationText(); log.UserName_KeyPress(sender, e); }
public string Format(ValidationText validationText) => _text;
public CustomValidationState(bool isValid, string message) { IsValid = isValid; Text = isValid ? ValidationText.Empty : ValidationText.Create(message); }