public void FindInAllDocuments()
{
using (OpenTestProject(true))
{
Assert.IsTrue(InvokeMainMenuItem("Edit", "Find in Files"));
var findWindow = new FindWindow(MainWindow.Children["Find and Replace", ControlType.Window]);
Assert.AreEqual(LookInType.EntireProject, findWindow.LookInType);
findWindow.FindWhat = "A\\da";
findWindow.MatchCase = true;
findWindow.MatchWholeWord = true;
findWindow.UseRegularExpressions = true;
findWindow.LookInFileTypes = null;
for (int i = 0; i < 4; i++)
{
findWindow.FindNext();
var messageBoxControl = findWindow.Window.Children[ControlType.Window];
if (messageBoxControl != null)
{
Assert.AreEqual(3, i);
new MessageBoxWindow(messageBoxControl).Click(MessageBoxButton.Cancel);
break;
}
var editorPanel = FindActiveDocument();
Assert.IsNotNull(editorPanel);
var editor = editorPanel.Children[0].Children[0];
var selection = editor.Text.GetSelection();
Assert.AreEqual(1, selection.Length);
Assert.AreEqual("A" + (i + 1) + "a", selection[0].GetText(int.MaxValue));
}
findWindow.Window.Window.Close();
CloseProject();
}
}