Esempio n. 1
0
        internal ExecutionSummary Run(IReadOnlyList <Type> candidateTypes, Discovery discovery, Execution execution)
        {
            bus.Publish(new AssemblyStarted(assembly));

            var assemblySummary = new ExecutionSummary();
            var stopwatch       = Stopwatch.StartNew();

            var classDiscoverer = new ClassDiscoverer(discovery);
            var classRunner     = new ClassRunner(bus, discovery, execution);

            var testClasses = classDiscoverer.TestClasses(candidateTypes);

            bool isOnlyTestClass = testClasses.Count == 1;

            foreach (var testClass in testClasses)
            {
                var classSummary = classRunner.Run(testClass, isOnlyTestClass);
                assemblySummary.Add(classSummary);
            }

            stopwatch.Stop();
            bus.Publish(new AssemblyCompleted(assembly, assemblySummary, stopwatch.Elapsed));

            return(assemblySummary);
        }
Esempio n. 2
0
        void Pass(Case @case, ExecutionSummary summary)
        {
            var message = new CasePassed(@case);

            summary.Add(message);
            bus.Publish(message);
        }
Esempio n. 3
0
        void Fail(Case @case, ExecutionSummary summary)
        {
            var message = new CaseFailed(@case);

            summary.Add(message);
            bus.Publish(message);
        }
Esempio n. 4
0
        void Skip(Case @case, ExecutionSummary summary)
        {
            var message = new CaseSkipped(@case);

            summary.Add(message);
            bus.Publish(message);
        }
Esempio n. 5
0
        void Run(Discovery discovery, Execution execution, Type[] candidateTypes, ExecutionSummary assemblySummary)
        {
            var classDiscoverer = new ClassDiscoverer(discovery);
            var classRunner     = new ClassRunner(bus, discovery, execution);

            var testClasses = classDiscoverer.TestClasses(candidateTypes);

            bool isOnlyTestClass = testClasses.Count == 1;

            foreach (var testClass in testClasses)
            {
                var classSummary = classRunner.Run(testClass, isOnlyTestClass);
                assemblySummary.Add(classSummary);
            }
        }