Beispiel #1
0
        public void TestClearErrorProviders()
        {
            //---------------Set up test pack-------------------
            IClassDef    classDef       = Sample.CreateClassDefWithTwoPropsOneCompulsory();
            PanelBuilder panelBuilder   = new PanelBuilder(GetControlFactory());
            IPanelInfo   panelInfo      = panelBuilder.BuildPanelForTab((UIFormTab)classDef.UIDefCol["default"].UIForm[0]);
            Sample       businessObject = new Sample();

            panelInfo.BusinessObject = businessObject;

            //businessObject.SetPropertyValue("SampleText2", "sdlkfj");
            PanelInfo.FieldInfo fieldInfo = panelInfo.FieldInfos["SampleText2"];
            panelInfo.ApplyChangesToBusinessObject();
            IErrorProvider errorProvider = fieldInfo.ControlMapper.ErrorProvider;

            //---------------Assert Precondition----------------
            Assert.IsTrue(errorProvider.GetError(fieldInfo.InputControl).Length > 0);
            //---------------Execute Test ----------------------
            panelInfo.ClearErrorProviders();
            //---------------Test Result -----------------------
            Assert.IsFalse(errorProvider.GetError(fieldInfo.InputControl).Length > 0);
        }