Ejemplo n.º 1
0
        private static void ShutDown()
        {
            if (runner == null)
                return;

            runner.Dispose();
            runner = null;
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            SubscribeToApplicationExit();

            runner = new RavenTestRunner();
            var progressIndicator = new Progress<ProgressReport>(progressReport => Console.WriteLine(progressReport.Message));
            var cancellationtokenSource = new CancellationTokenSource();
            var token = cancellationtokenSource.Token;
            var task = runner.RunAllTests(progressIndicator, token, "C:\\RavenDB-Build-2750");
            task.ContinueWith(continuation =>
                {
                    if (continuation.IsCanceled)
                    {
                        Console.WriteLine("Tests cancelled");
                    }
                    else if (continuation.IsCompleted)
                    {
                        DisplayResults(continuation.Result);
                    }
                });

            var shouldQuit = false;
            while (!shouldQuit)
            {
                var key = Console.ReadKey();
                switch (key.Key)
                {
                        case ConsoleKey.T:
                            Console.WriteLine("Test");
                        break;
                        case ConsoleKey.C:
                            cancellationtokenSource.Cancel();
                        break;
                        case ConsoleKey.Escape:
                            shouldQuit = true;
                        break;
                }
            }

        }