Exemplo n.º 1
0
        public void Replace_Origin_With_Moto(
            string origin, string findWith, string replaceWith, string expected,
            bool isMatchCase, bool isMatchWholeWord, bool shouldBeTrue)
        {
            // arrange
            var @params = new FindReplaceParams
            {
                FindWith         = findWith,
                ReplaceWith      = replaceWith,
                IsMatchCase      = isMatchCase,
                IsMatchWholeWord = isMatchWholeWord
            };

            // act
            var result = _findReplaceTool.Replace(origin, @params).Line;

            // assert
            if (shouldBeTrue)
            {
                result.Should().Be(expected);
            }
            else
            {
                result.Should().NotBe(expected);
            }
        }
Exemplo n.º 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var model = new FindReplaceParams
            {
                FindWith    = "Find test",
                ReplaceWith = "Replace test",
                IsMatchCase = true,
                IsUseRegex  = true
            };

            var control = new FindReplaceControl();

            control.SetModel(model);

            var form = FormTools.GetFormForControl(control);

            form.ShowDialog();

            var @params = control.GetModel();



            //Application.Run(new Main());
        }
Exemplo n.º 3
0
 public void SetModel(FindReplaceParams model)
 {
     PropertyMapper.MapProperties(model, Model);
 }