private static void GetConversationDialogModel(out MockConversationSearchTarget searchTarget, out IFindDialogModel findDialogModel)
        {
            searchTarget = new MockConversationSearchTarget();
            searchTarget.SearchTargetControl = GetConversationRichTextBox();

            findDialogModel = new FindDialogModel(searchTarget);
        }
        private int WordInstancesFoundReverse(IFindDialogModel model, MockConversationSearchTarget searchTarget, string word)
        {
            int instancesFound = 0;

            int lastMatchIndex = int.MaxValue;

            while (model.LastQuerySuccessful)
            {
                model.Query = word;
                model.SearchDisplayedConversation(SearchDirection.Up);

                if (!model.LastQuerySuccessful || (searchTarget.MatchIndex > lastMatchIndex))
                {
                    break;
                }
                else
                {
                    lastMatchIndex = searchTarget.MatchIndex;
                }

                instancesFound++;
            }

            return(instancesFound);
        }
        private int FindWordInStringHelper(string toFind, string target, SearchDirection direction, bool isCaseSensitive)
        {
            MockConversationSearchTarget searchTarget = new MockConversationSearchTarget();

            searchTarget.SearchTargetControl = CreateRichTextBoxWithContent(target);

            FindDialogModel_Accessor model = new FindDialogModel_Accessor(searchTarget);

            model.CaseSensitive = isCaseSensitive;

            return(model.FindWordInString(toFind, target, direction));
        }
        private int WordInstancesFoundMatchCase(IFindDialogModel model, MockConversationSearchTarget searchTarget, string word)
        {
            model.CaseSensitive = true;

            return(WordInstancesFound(model, searchTarget, word));
        }
        private int WordInstancesFoundReverse(IFindDialogModel model, MockConversationSearchTarget searchTarget, string word)
        {
            int instancesFound = 0;

            int lastMatchIndex = int.MaxValue;

            while (model.LastQuerySuccessful)
            {
                model.Query = word;
                model.SearchDisplayedConversation(SearchDirection.Up);

                if (!model.LastQuerySuccessful || (searchTarget.MatchIndex > lastMatchIndex))
                {
                    break;
                }
                else
                {
                    lastMatchIndex = searchTarget.MatchIndex;
                }

                instancesFound++;
            }

            return instancesFound;
        }
        private int WordInstancesFoundMatchCase(IFindDialogModel model, MockConversationSearchTarget searchTarget, string word)
        {
            model.CaseSensitive = true;

            return WordInstancesFound(model, searchTarget, word);
        }
        private int FindWordInStringHelper(string toFind, string target, SearchDirection direction, bool isCaseSensitive)
        {
            MockConversationSearchTarget searchTarget = new MockConversationSearchTarget();
            searchTarget.SearchTargetControl = CreateRichTextBoxWithContent(target);

            FindDialogModel_Accessor model = new FindDialogModel_Accessor(searchTarget);

            model.CaseSensitive = isCaseSensitive;

            return model.FindWordInString(toFind, target, direction);
        }
        private static void GetSingleLineDialogModel(out MockConversationSearchTarget searchTarget, out IFindDialogModel findDialogModel)
        {
            searchTarget = new MockConversationSearchTarget();
            searchTarget.SearchTargetControl = GetSingleLineRichTextBox();

            findDialogModel = new FindDialogModel(searchTarget);
        }