Пример #1
0
        public void R_SelectWord03()
        {
            using (var script = new TestScript("abc\'def", RContentTypeDefinition.ContentType)) {
                script.Execute(Languages.Editor.Controller.Constants.VSConstants.VSStd2KCmdID.SELECTCURRENTWORD);
                var span         = EditorWindow.CoreEditor.View.Selection.StreamSelectionSpan;
                var selectedWord = span.GetText();
                selectedWord.Should().Be("abc");

                script.MoveRight(2);
                script.Execute(Languages.Editor.Controller.Constants.VSConstants.VSStd2KCmdID.SELECTCURRENTWORD);
                span         = EditorWindow.CoreEditor.View.Selection.StreamSelectionSpan;
                selectedWord = span.GetText();
                selectedWord.Should().Be("def");
            }
        }
Пример #2
0
 public void R_FormatDocument(string original, string expected)
 {
     using (var script = new TestScript(original, RContentTypeDefinition.ContentType)) {
         script.Execute(VSConstants.VSStd2KCmdID.FORMATDOCUMENT, 50);
         string actual = script.EditorText;
         actual.Should().Be(expected);
     }
 }
Пример #3
0
        public void Start()
        {
            TempReader temp = new TempReader().ReadContent();

            this.TestContext.WriteLine("Current Test Case ID: {0}", temp.TcID);
            this.TestContext.WriteLine("Current Test Case Folder: {0}", temp.TcFolder);

            string     xmlpath = temp.TcFolder.Substring(temp.TcFolder.Length - 2) == "\\" ? temp.TcFolder + "DataTable.xml" : temp.TcFolder + "\\DataTable.xml";
            TestScript ts      = new TestScript(temp.TcID, xmlpath, this.TestContext);

            ts.Execute();
        }
Пример #4
0
        public void R_FormatSelection01()
        {
            string content  = "\nwhile (TRUE) {\n        if(x>1) {\n   }\n}";
            string expected = "\nwhile (TRUE) {\n    if (x > 1) {\n    }\n}";

            using (var script = new TestScript(content, RContentTypeDefinition.ContentType)) {
                script.Select(20, 18);
                script.Execute(VSConstants.VSStd2KCmdID.FORMATSELECTION, 50);
                string actual = script.EditorText;

                actual.Should().Be(expected);
            }
        }