/// <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 TestIsContainingTextBoxIsMailFlag() { Assert.IsTrue(InputInspectorTypeHelper.IsContainingTextBoxIsMailFlag(15)); Assert.IsFalse(InputInspectorTypeHelper.IsContainingTextBoxIsMailFlag(10)); }