Esempio n. 1
0
        private async Task ExecuteTestsAync()
        {
            try
            {
                Running = true;
                Results = null;
                var results = await _testPackage.ExecuteTests();

                var summary = await _testPackage.ProcessResults(results);

                Device.BeginInvokeOnMainThread(async() =>
                {
                    if (Options.OnCompletedCallback != null)
                    {
                        await Options.OnCompletedCallback();
                    }

                    Results = summary;
                    Running = false;
                });
            }
            catch (Exception ex)
            {
                RealConsole.WriteLine(ex.Message);
            }
            finally
            {
                Running = false;
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            IConsole  console = new RealConsole();
            ProgramUI ui      = new ProgramUI(console); //calling programui.cs and starting that

            ui.Run();
        }
Esempio n. 3
0
        public void WriteToRealConsole()
        {
            IConsole sut = new RealConsole();

            sut.Write("Here is a simple text");
            sut.WriteLine("Here is another with a linebreak");
        }
        public static void Main(string[] args)
        {
            var console      = new RealConsole();
            var eventManager = new EventManager(console);

            eventManager.Run();
        }
        static void Main(string[] args)
        {
            RealConsole console = new RealConsole();
            ProgramUI   program = new ProgramUI(console);

            program.Run();
        }
Esempio n. 6
0
        static void Main(string[] args)
        {
            IConsole  console = new RealConsole(); // IConsole console = the specific class console this tells it to use the real console
            ProgramUI ui      = new ProgramUI(console);

            ui.Run();// only have access to Run because RunMenu is not accessible
        }
Esempio n. 7
0
        static void Main(string[] args)
        {
            IConsole  console = new RealConsole();
            ProgramUI ui      = new ProgramUI(console);

            ui.Run();
        }
Esempio n. 8
0
        private static void LogTestRun(ITestResult result)
        {
            var total   = result.FailCount + result.PassCount + result.InconclusiveCount;
            var message = $"Test run finished: {total} Passed: {result.PassCount} Failed: {result.FailCount} ({result.EndTime - result.StartTime:c})";

            RealConsole.WriteLine(message);
        }
Esempio n. 9
0
        static void Main(string[] args)
        {
            IConsole console = new RealConsole();
            // create an instance of ProgramUI so we can execute the Run method
            ProgramUI ui = new ProgramUI(console);

            ui.Run();
        }
Esempio n. 10
0
        static void Main(string[] args)
        {
            Console.Title = "Komodo Apps - Claims Manager";
            IConsole      console       = new RealConsole();
            ClaimsManager claimsManager = new ClaimsManager(console);

            claimsManager.Run();
        }
Esempio n. 11
0
        static void Main(string[] args)
        {
            Console.Title = "Komodo Apps - Badge Manager";
            IConsole     console = new RealConsole();
            BadgeManager manager = new BadgeManager(console);

            manager.Run();
        }
Esempio n. 12
0
 public static void Main(string[] args)
 {
     var console = new RealConsole();
     var projectRepository = new ProjectRepository();
     var taskRepository = new TaskRepository();
     var taskList = new TaskList(console, projectRepository, taskRepository);
     taskList.Run();
 }
Esempio n. 13
0
        static void Main(string[] args)
        {
            // Declare a RealConsole for the "production" app
            var console = new RealConsole();
            // UI Class Instance
            ProgramUI ui = new ProgramUI(console);

            ui.Start();
        }
        public void WriteLineOutputsText()
        {
            //Arrange
            var console = new RealConsole();

            //Act
            console.WriteLine("Foo");

            //Assert
            //use ConsoleAssert
        }
        // Main method is the entry point that starts the application
        // has one responsiblity to
        static void Main(string[] args)
        {
            // Declare a RealConsole for the "production" app
            var console = new RealConsole();

            // UI Class Instance, a tangible copy of this class
            // now have access to anything in ProgramUI that is made public
            ProgramUI ui = new ProgramUI(console);

            ui.StartRun();
        }
Esempio n. 16
0
        static void Main(string[] args)
        {
            // Declare a RealConsole for the "production" app
            var console = new RealConsole();

            // UI Class Instance
            // creating new ProgramUI class
            ProgramUI ui = new ProgramUI(console);

            // calling Start method (instance) from ProgramUI class
            // directs us to what code we want to run next
            ui.Start();
        }
Esempio n. 17
0
        /// <summary>
        /// Constructs a new app adding the current assembly to be tested.
        /// <param name="output">Stream where the output is redirected. Default value is Console.Out.</param>
        /// </summary>
        public App(TextWriter output = null)
        {
            InitializeComponent();

            RealConsole.Init(output ?? Console.Out);

            // OnPlatform only reports WinPhone for WinPhone Silverlight, so swap
            // out the background color in code instead
            if (Device.RuntimePlatform == Device.UWP)
            {
                Resources["defaultBackground"] = Resources["windowsBackground"];
            }

            _model   = new SummaryViewModel();
            MainPage = new NavigationPage(new SummaryView(_model));
            AddTestAssembly(Assembly.GetCallingAssembly());
        }
Esempio n. 18
0
            public void TestFinished(ITestResult result)
            {
                if (!result.Test.IsSuite)
                {
                    var className = result.Test.ClassName?.Split('.').LastOrDefault();
                    var status    = result.ResultState.Status.ToString().ToUpper();

                    var message = $"\t[{status}] {className}.{result.Test.Name} ({(result.EndTime - result.StartTime).TotalMilliseconds} ms)";

                    if (result.ResultState.Status == TestStatus.Failed)
                    {
                        message += $"\t\t{Environment.NewLine}{result.Message} - {result.StackTrace}";
                    }

                    RealConsole.WriteLine(message);
                }
            }
Esempio n. 19
0
        public override async Task Process(ResultSummary result)
        {
            if (Options.CreateXmlResultFile == false)
            {
                return;
            }

            try
            {
                WriteXmlResultFile(result);
            }
            catch (Exception ex)
            {
                RealConsole.WriteLine("Fatal error while trying to write xml result file! " + ex.Message);
                throw;
            }

            if (Successor != null)
            {
                await Successor.Process(result).ConfigureAwait(false);
            }
        }
        public void WriteLine_OutputsLineOnTheConsole()
        {
            var console = new RealConsole();

            ConsoleAssert.Expect(">>Output line", () => console.WriteLine("Output line"));
        }
        public void ReadLine_ReadsLineFromConsole()
        {
            var console = new RealConsole();

            ConsoleAssert.Expect("<<Testing line", () => console.ReadLine());
        }