private static IEditor TestOneSurroundWithSnippet(IVisualStudioInstance vs, Snippet snippet, string body = "42", string file = "nonempty.py") { Console.WriteLine("Testing: {0}", snippet.Shortcut); var editor = vs.OpenItem("SnippetsTest", file); editor.Select(1, 1, editor.Text.Length); editor.Invoke(() => editor.TextView.Caret.EnsureVisible()); vs.ExecuteCommand("Edit.SurroundWith"); return(VerifySnippet(snippet, body, editor)); }
private static IEditor TestOneSurroundWithSnippet(IVisualStudioInstance solution, Snippet snippet, string body = "42", string file = "nonempty.py") { Console.WriteLine("Testing: {0}", snippet.Shortcut); var app = solution.OpenItem("SnippetsTest", file); app.Select(1, 1, app.Text.Length); app.Invoke(() => app.TextView.Caret.EnsureVisible()); app.SetFocus(); solution.ExecuteCommand("Edit.SurroundWith"); return(VerifySnippet(snippet, body, app)); }
private static IEditor TestOneInsertSnippetMoveCaret(IVisualStudioInstance vs, Snippet snippet, string category, string body = "42", string file = "nonempty.py", int line = 1) { Console.WriteLine("Testing: {0}", snippet.Shortcut); var editor = vs.OpenItem("SnippetsTest", file); editor.MoveCaret(line, 1); editor.Invoke(() => editor.TextView.Caret.EnsureVisible()); vs.ExecuteCommand("Edit.InsertSnippet"); Keyboard.Type(category + "\t"); return(VerifySnippet(snippet, body, editor)); }
private static IEditor TestOneInsertSnippet(IVisualStudioInstance solution, Snippet snippet, string category, string body = "nonempty", string file = "nonempty.js") { Console.WriteLine("Testing: {0}", snippet.Shortcut); var server = solution.OpenItem("SnippetsTest", file); server.Select(1, 1, server.Text.Length); server.Invoke(() => server.TextView.Caret.EnsureVisible()); server.SetFocus(); solution.ExecuteCommand("Edit.InsertSnippet"); Keyboard.Type(category + "\t"); return(VerifySnippet(snippet, body, server)); }
private static IEditor TestOneSurroundWithSnippet(IVisualStudioInstance solution, Snippet snippet, string category, string body = "nonempty", string file = "nonempty.js") { Console.WriteLine("Testing: {0}", snippet.Shortcut); var server = solution.OpenItem("SnippetsTest", file); server.Select(1, 1, server.Text.Length); server.Invoke(() => server.TextView.Caret.EnsureVisible()); server.SetFocus(); solution.ExecuteCommand("Edit.SurroundWith"); Keyboard.Type(category + "\t"); return VerifySnippet(snippet, body, server, insertViaMenu: true); }
private static IEditor TestOneInsertSnippetMoveCaret(IVisualStudioInstance solution, Snippet snippet, string category, string body = "42", string file = "nonempty.py", int line = 1) { Console.WriteLine("Testing: {0}", snippet.Shortcut); var app = solution.OpenItem("SnippetsTest", file); app.MoveCaret(line, 1); app.Invoke(() => app.TextView.Caret.EnsureVisible()); app.SetFocus(); solution.ExecuteCommand("Edit.InsertSnippet"); Keyboard.Type(category + "\t"); return VerifySnippet(snippet, body, app); }
private static IEditor TestOneSurroundWithSnippet(IVisualStudioInstance solution, Snippet snippet, string body = "42", string file = "nonempty.py") { Console.WriteLine("Testing: {0}", snippet.Shortcut); var app = solution.OpenItem("SnippetsTest", file); app.Select(1, 1, app.Text.Length); app.Invoke(() => app.TextView.Caret.EnsureVisible()); app.SetFocus(); solution.ExecuteCommand("Edit.SurroundWith"); return VerifySnippet(snippet, body, app); }