public void TestAreAllValidInputInspectors()
        {
            List <IInputInspector> inspectors = new List <IInputInspector>()
            {
                new TextBoxIsNotEmptyInspector("", TestDefinition.DUMP_INTEGER), new DropDownListIsSelectedInspector(TestDefinition.DUMP_INTEGER)
            };

            _target.SetFieldOrProperty(MEMBER_VARIABLE_NAME_INSPECTORS, inspectors);
            Assert.IsFalse(_inputInspectorsCollection.AreAllValidInputInspectors());
            inspectors = new List <IInputInspector>()
            {
                new TextBoxIsNotEmptyInspector("aaa", TestDefinition.DUMP_INTEGER), new DropDownListIsSelectedInspector(0)
            };
            _target.SetFieldOrProperty(MEMBER_VARIABLE_NAME_INSPECTORS, inspectors);
            Assert.IsTrue(_inputInspectorsCollection.AreAllValidInputInspectors());
        }
コード例 #2
0
 /// <summary>
 /// Update the view of the error provider and the member variable _isValidProductInfo inside the presentation model.
 /// </summary>
 private void UpdateErrorProviderViewAndIsValidProductInfo(Control control, string controlInputInspectorsError)
 {
     _errorProvider.SetError(control, controlInputInspectorsError);
     _productManagementPresentationModel.SetIsValidProductInfo(_inputInspectorsCollection.AreAllValidInputInspectors());
 }
コード例 #3
0
 /// <summary>
 /// Update the enabled state of the submit button.
 /// </summary>
 private void UpdateSubmitButtonView()
 {
     _submitButton.Enabled = _inputInspectorsCollection.AreAllValidInputInspectors();
 }