Пример #1
0
        public void OpenEditCompile()
        {
            var slnFile = IdeApi.OpenTestSolution("ConsoleApp-VS2010/ConsoleApplication.sln");
            var slnDir  = slnFile.ParentDirectory;

            var exe = slnDir.Combine("bin", "Debug", "ConsoleApplication.exe");

            Assert.IsFalse(File.Exists(exe));

            IdeApi.OpenFile(slnFile.ParentDirectory.Combine("Program.cs"));

            IdeApi.BuildSolution();
            AssertExeHasOutput(exe, "");

            //select text editor, move down 10 lines, and insert a statement
            Session.SelectActiveWidget();
            for (int n = 0; n < 10; n++)
            {
                Session.ExecuteCommand(TextEditorCommands.LineDown);
            }
            Session.ExecuteCommand(TextEditorCommands.LineEnd);
            Session.TypeText("\nConsole.WriteLine (\"Hello World!\");");

            IdeApi.BuildSolution();
            AssertExeHasOutput(exe, "Hello World!");

            IdeApi.CloseAll();
        }
Пример #2
0
 public static void OpenFile(FilePath file)
 {
     TestService.Session.GlobalInvoke("MonoDevelop.Ide.IdeApp.Workbench.OpenDocument", (FilePath)file, true);
     Assert.AreEqual(file, IdeApi.GetActiveDocumentFilename());
 }