Ejemplo n.º 1
0
        public void OpenEditCompile()
        {
            var slnFile = Ide.OpenTestSolution("ConsoleApp-VS2010/ConsoleApplication.sln");
            var slnDir  = slnFile.ParentDirectory;

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

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

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

            Ide.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!\");");

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

            Ide.CloseAll();
        }
Ejemplo n.º 2
0
        public void OpenEditCompile()
        {
            var slnFile = Ide.OpenTestSolution("ConsoleApp-VS2010/ConsoleApplication.sln");
            var slnDir  = slnFile.ParentDirectory;

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

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

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


            //select text editor, move down 10 lines, and insert a statement
            Session.SelectActiveWidget();
            Session.ExecuteCommand(TextEditorCommands.DocumentStart);
            // Delete all the code already existing
            for (int i = 0; i < 20; i++)
            {
                Session.ExecuteCommand(TextEditorCommands.DeleteLine);
            }

            // Entering Program With an Error

            Session.TypeText("\nusing System;");
            Session.TypeText("\nnamespace ConsoleProject {");
            Session.TypeText("\nclass MainClass {");
            Session.TypeText("\npublic static void Main (string[] args) {");
            Session.TypeText("\nList<string> s = new List<string> () {\"one\", \"two\", \"three\"};");
            Session.TypeText("\nConsole.WriteLine (\"Hello Xamarin!\"); }");
            Session.TypeText("\n} }");

            Ide.BuildSolution();


            AssertExeHasOutput(exe, "Hello Xamarin!");


            Ide.CloseAll();
        }
Ejemplo n.º 3
0
        public void ZCorrectIt()
        {
            var slnFile = Ide.OpenTestSolution("ConsoleApp-VS2010/ConsoleApplication.sln");
            var slnDir  = slnFile.ParentDirectory;

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

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

            Ide.OpenFile(slnFile.ParentDirectory.Combine("Program.cs"));
            Session.SelectActiveWidget();
            for (int i = 0; i < 20; i++)
            {
                Session.ExecuteCommand(TextEditorCommands.DeleteLine);
            }

            Session.ExecuteCommand(TextEditorCommands.DocumentStart);
            Session.ExecuteCommand(TextEditorCommands.InsertNewLine);

            // Entering the Correct Program
            Session.TypeText("\nusing System;");
            Session.TypeText("\nusing System.Collections.Generic;");
            Session.TypeText("\nnamespace ConsoleProject {");
            Session.TypeText("\nclass MainClass {");
            Session.TypeText("\npublic static void Main (string[] args) {");
            Session.TypeText("\nList<string> s = new List<string> () {\"one\", \"two\", \"three\"};");
            Session.TypeText("\nConsole.WriteLine (\"Hello Xamarin!\"); }");

            Session.TypeText("\n} }");

            Session.ExecuteCommand(TextEditorCommands.LineDown);
            Ide.BuildSolution();

            AssertExeHasOutput(exe, "Hello Xamarin!");


            Ide.CloseAll();
        }