public void TestIsInRangeOfTextBoxInspectorTypes()
 {
     Assert.IsFalse(InputInspectorTypeHelper.IsInRangeOfTextBoxInspectorTypes(0));
     Assert.IsFalse(InputInspectorTypeHelper.IsInRangeOfTextBoxInspectorTypes(8));
     for (int flag = 1; flag <= 7; flag++)
     {
         Assert.IsTrue(InputInspectorTypeHelper.IsInRangeOfTextBoxInspectorTypes(flag));
     }
 }
 /// <summary>
 /// Add drop-down list inspectors by dropDownListInspectorTypeFlag.
 /// </summary>
 public void AddDropDownListInspectors(int dropDownListInspectorTypeFlag, int selectedIndex)
 {
     if (!InputInspectorTypeHelper.IsInRangeOfDropDownListInspectorTypes(dropDownListInspectorTypeFlag))
     {
         throw new ArgumentOutOfRangeException(ERROR_DROP_DOWN_LIST_INSPECTOR_TYPE_FLAG_IS_OUT_OF_RANGE);
     }
     if (InputInspectorTypeHelper.IsContainingDropDownListIsSelectedFlag(dropDownListInspectorTypeFlag))
     {
         _inspectors.Add(new DropDownListIsSelectedInspector(selectedIndex));
     }
 }
예제 #3
0
 /// <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 TestIsContainingDropDownListIsSelectedFlag()
 {
     Assert.IsTrue(InputInspectorTypeHelper.IsContainingDropDownListIsSelectedFlag(24));
     Assert.IsFalse(InputInspectorTypeHelper.IsContainingDropDownListIsSelectedFlag(16));
 }
 public void TestIsContainingTextBoxIsOfFullLengthFlag()
 {
     Assert.IsTrue(InputInspectorTypeHelper.IsContainingTextBoxIsOfFullLengthFlag(4));
     Assert.IsFalse(InputInspectorTypeHelper.IsContainingTextBoxIsOfFullLengthFlag(80));
 }
 public void TestIsContainingTextBoxIsNotEmptyFlag()
 {
     Assert.IsTrue(InputInspectorTypeHelper.IsContainingTextBoxIsNotEmptyFlag(14));
     Assert.IsFalse(InputInspectorTypeHelper.IsContainingTextBoxIsNotEmptyFlag(9));
 }
 public void TestIsContainingTextBoxIsMailFlag()
 {
     Assert.IsTrue(InputInspectorTypeHelper.IsContainingTextBoxIsMailFlag(15));
     Assert.IsFalse(InputInspectorTypeHelper.IsContainingTextBoxIsMailFlag(10));
 }
 public void TestIsInRangeOfDropDownListInspectorTypes()
 {
     Assert.IsFalse(InputInspectorTypeHelper.IsInRangeOfDropDownListInspectorTypes(7));
     Assert.IsTrue(InputInspectorTypeHelper.IsInRangeOfDropDownListInspectorTypes(8));
     Assert.IsFalse(InputInspectorTypeHelper.IsInRangeOfDropDownListInspectorTypes(9));
 }