public void ReplaceReplaceAllProblem1()
        {
            RapidFindReplaceControlViewModel finder = new RapidFindReplaceControlViewModel();
            FlowDocument content = LoadFlowDocument("FlowDocument1.xaml");
            System.Collections.Generic.List<Run> runs = new System.Collections.Generic.List<Run>(5);
            //FindRuns(content.Blocks, runs);
            runs.Add(new Run("aaaa"));

            RunCollectionContainer coll = new RunCollectionContainer(runs);

           
            finder.Query = new Query("aaaa");
            finder.FindText(coll);

           
            
            finder.ReplaceMatchCommand.Execute("ddd");
            finder.ReplaceAllMatchesCommand.Execute("ddd");
            
        }
        public void FindDoubleSpace()
        {
            RapidFindReplaceControlViewModel finder = new RapidFindReplaceControlViewModel();
           
            System.Collections.Generic.List<Run> runs = new System.Collections.Generic.List<Run>(5);
            //FindRuns(content.Blocks, runs);
            runs.Add(new Run("a  a"));
            runs.Add(new Run("T"));

            RunCollectionContainer coll = new RunCollectionContainer(runs);

 
            finder.Query = new Query("  ");
            finder.FindText(coll);

            finder.SelectNextMatch();
            
         
            Assert.AreEqual(1, finder.CurrentMatch.AbsoluteStart);
            Assert.AreEqual(3, finder.CurrentMatch.AbsoluteEnd);
            
        }
        public void ReplaceAsFindWithPrependSpace()
        {
            RapidFindReplaceControlViewModel finder = new RapidFindReplaceControlViewModel();
            

            System.Collections.Generic.List<Run> runs = new System.Collections.Generic.List<Run>(5);
            //FindRuns(content.Blocks, runs);
            runs.Add(new Run("ax  ax"));
            runs.Add(new Run("T"));

            RunCollectionContainer coll = new RunCollectionContainer(runs);


            finder.Query = new Query("ax");
            finder.FindText(coll);

          

            finder.ReplaceAllMatchesCommand.Execute(" ax");
           
        }