public bool AssertTextMatching(string pattern, string trueMessage = "", string falseMessage = "")
{
Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.CultureInvariant);
Match match = rgx.Match(this.innerText);
if (match.Success)
{
if (trueMessage != "")
Log.MesPass(trueMessage);
return true;
}
else
{
if (falseMessage != "")
Log.MesError(String.Format("{0} \r\n\r\nОжидалось: {1} \r\n\r\nНо было: {2}", falseMessage, pattern, this.innerText));
return false;
}
}