//---------------------------------------------------------------------------
// Wrapper for TextPatternRange.GetAttributeValue Method
//---------------------------------------------------------------------------
internal void Range_GetAttributeValue(TextPatternRange callingRange, AutomationTextAttribute attrib, ref object val, Type expectedException, CheckType checkType)
{
string call = "";
if (attrib != null)
call = "TextPatternRange.GetAttributeValue(" + Helpers.GetProgrammaticName(attrib) + ")";
else
call = "TextPatternRange.GetAttributeValue(NULL)";
Comment("---Calling " + call);
if (callingRange == null)
throw new ArgumentNullException(call + " requires non-NULL TextPatterncallingRange");
try
{
val = callingRange.GetAttributeValue(attrib);
if (val.Equals(AutomationElement.NotSupported))
{
string msg = Helpers.GetProgrammaticName(attrib) + " not supported by control";
Comment(msg);
}
}
catch (Exception actualException)
{
if (Library.IsCriticalException(actualException))
throw;
TestException(expectedException, actualException, call, checkType);
return;
}
TestNoExceptionQuiet(expectedException, call, checkType);
}