Beispiel #1
0
        static void Main(string[] commandLineArgs)
        {
            var args = new ProgramArgs(commandLineArgs);

            if (!args.AreValid)
            {
                Console.WriteLine(args.Errors);
                return;
            }

            using (var reader = new XmlTextReader(new FileStream(args.TestResultsFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)))
            {
                var doc = XDocument.Load(reader);
                var tests = from suite in doc.Descendants("test-case")
                             select new
                                    {
                                        Name = AttributeValue(suite, "name"),
                                        Time = decimal.Parse(AttributeValue(suite, "time") ?? "0")
                                    };

                var slowTests = (from t in tests
                                 orderby t.Time descending
                                 select t).Take(10);

                foreach (var test in slowTests)
                {
                    Console.WriteLine("{0}\t{1}", test.Time, test.Name);
                }
            }
        }
Beispiel #2
0
        static void Main(string[] commandLineArgs)
        {
            var args = new ProgramArgs(commandLineArgs);

            if (!args.AreValid)
            {
                Console.WriteLine(args.Errors);
                return;
            }

            var currentCoverage = new CoverageFile(args.CurrentFile, new XmlTextReader(new FileStream(args.CurrentFile, FileMode.Open)));
            var prevCoverage = new CoverageFile(args.PrevFile, new XmlTextReader(new FileStream(args.PrevFile, FileMode.Open)));

            using(var htmlFileStream = new FileStream("coverdiff.html", FileMode.Create, FileAccess.Write, FileShare.Read))
            {
                var comparer = new HtmlReportGenerator(htmlFileStream);
                comparer.Report(new CoverageComparer(currentCoverage, prevCoverage));
            }
        }