Пример #1
0
        private static void ProcessTestSummaryTransformers(CommandLine commandLine, TestCaseSummary testResultsSummary)
        {
            var transformers = new SummaryTransformerProvider().GetTransformers(new FileSystemWrapper());

            foreach (var transformer in transformers.Where(x => commandLine.UnmatchedArguments.ContainsKey(x.Name)))
            {
                var path = commandLine.UnmatchedArguments[transformer.Name];
                transformer.Transform(testResultsSummary, path);
            }
        }
Пример #2
0
        public static int Main(string[] args)
        {
            if (Environment.GetEnvironmentVariable("ATTACH_DEBUGGER_CHUTZPAH") != null)
            {
                Debugger.Launch();
            }


            var transformers = new SummaryTransformerProvider().GetTransformers(new FileSystemWrapper());

            if (args.Length == 0 || args[0] == "/?")
            {
                PrintHeader();
                PrintUsage(transformers);
                return(-1);
            }

            AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

            try
            {
                CommandLine commandLine = CommandLine.Parse(args, transformers.Select(x => x.Name));

                if (!commandLine.NoLogo)
                {
                    PrintHeader();
                }

                int failCount = RunTests(commandLine, transformers);

                if (commandLine.Wait)
                {
                    Console.WriteLine();
                    Console.Write("Press any key to continue...");
                    Console.ReadKey();
                    Console.WriteLine();
                }

                return(failCount);
            }
            catch (ArgumentException ex)
            {
                Console.WriteLine();
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("error: {0}", ex.Message);
                Console.ResetColor();
                return(-1);
            }
        }
Пример #3
0
        public void ReturnsSummaryTransformers_AsPerSummaryTransformerFactory()
        {
            var expected = SummaryTransformerFactory.GetTransformers(GetFileSystemWrapper());
            var actual   = new SummaryTransformerProvider().GetTransformers(GetFileSystemWrapper());

            foreach (var actualTransformer in actual)
            {
                var matchingByType = expected.FirstOrDefault(x => x.GetType() == actualTransformer.GetType());

                Assert.NotNull(matchingByType);
                Assert.Equal(matchingByType.Name, actualTransformer.Name);
                Assert.Equal(matchingByType.Description, actualTransformer.Description);
            }

            Assert.Equal(expected.Count(), actual.Count());
        }