Habanero.Faces.Win.ErrorProviderWin.SetError C# (CSharp) Method

SetError() public method

Sets the error description string for the specified control.
control is null.
public SetError ( IControlHabanero objControl, string strValue ) : void
objControl IControlHabanero The control to set the error description string for.
strValue string The error description string.
return void
        public void SetError(IControlHabanero objControl, string strValue)
        {
            base.SetError(GetControl(objControl), strValue);
        }

Usage Example

 public void Test_GetError_WhenWrappedControl_ShouldReturnTheErrorFromTheBaseControl()
 {
     //---------------Set up test pack-------------------
     var winFormsControlAdapter = GetWinFormsControlAdapter();
     var errorProviderWin = new ErrorProviderWin();
     var expectedErrorMessage = TestUtil.GetRandomString();
     errorProviderWin.SetError(winFormsControlAdapter, expectedErrorMessage);
     //---------------Assert Precondition----------------
     //---------------Execute Test ----------------------
     var actualErrorMessage = errorProviderWin.GetError(winFormsControlAdapter);
     //---------------Test Result -----------------------
     Assert.AreEqual(expectedErrorMessage, actualErrorMessage);
 }