Exemplo n.º 1
0
        public void ReplaceAllTest()
        {
            vm               = new FindReplaceDialogViewModel(ed);
            vm.UseRegex      = true;
            vm.TextToFind    = "sam[^\\s]*";
            vm.TextToReplace = "hello";
            //vm.Find();
            vm.ReplaceAllText();

            Assert.AreEqual("This is some hello text\non 3 different lines\nwith more hello",
                            ed.Text,
                            "Replacement Text");
        }
Exemplo n.º 2
0
        public void ReplaceAllTest()
        {
            var localEditor = new MockEditor("This is some sample text\non 3 different lines\nwith more samples");
            var vm          = new FindReplaceDialogViewModel(mockEventAggregator)
            {
                // need to ceatea a new editor for replaces tests as they change the text
                Editor        = localEditor,
                UseRegex      = true,
                UseWildcards  = false,
                CaseSensitive = false,
                TextToFind    = "sam[^\\s]*",
                TextToReplace = "hello"
            };

            //vm.Find();
            vm.ReplaceAllText();

            Assert.AreEqual("This is some hello text\non 3 different lines\nwith more hello",
                            localEditor.Text,
                            "Replacement Text");
        }