/// <summary> /// Add textbox inspectors by textBoxInspectorTypeFlag. /// </summary> public void AddTextBoxInspectors(int textBoxInspectorTypeFlag, string text, int maxTextLength) { if (!InputInspectorTypeHelper.IsInRangeOfTextBoxInspectorTypes(textBoxInspectorTypeFlag)) { throw new ArgumentException(ERROR_INVALID_TEXT_BOX_INSPECTOR_TYPE_FLAG); } if (InputInspectorTypeHelper.IsContainingTextBoxIsMailFlag(textBoxInspectorTypeFlag)) { _inspectors.Add(new TextBoxIsMailInspector(text, maxTextLength)); } if (InputInspectorTypeHelper.IsContainingTextBoxIsNotEmptyFlag(textBoxInspectorTypeFlag)) { _inspectors.Add(new TextBoxIsNotEmptyInspector(text, maxTextLength)); } if (InputInspectorTypeHelper.IsContainingTextBoxIsOfFullLengthFlag(textBoxInspectorTypeFlag)) { _inspectors.Add(new TextBoxIsOfFullLengthInspector(text, maxTextLength)); } }
public void TestIsContainingTextBoxIsOfFullLengthFlag() { Assert.IsTrue(InputInspectorTypeHelper.IsContainingTextBoxIsOfFullLengthFlag(4)); Assert.IsFalse(InputInspectorTypeHelper.IsContainingTextBoxIsOfFullLengthFlag(80)); }