Ejemplo n.º 1
0
        public void RunTests(IEnumerable<TestCase> tests, IRunContext runContext, IFrameworkHandle frameworkHandle)
        {
            this.frameworkHandle = frameworkHandle;

            var testLogger = new TestLogger(frameworkHandle);

            testLogger.SendMainMessage("Execution started");

            foreach (var group in tests.GroupBy(t => t.Source))
            {
                testLogger.SendInformationalMessage(String.Format("Running selected: '{0}'", group.Key));

                try
                {
                    using (var sandbox = new Sandbox<Executor>(group.Key))
                    {
                        var assemblyDirectory = new DirectoryInfo(Path.GetDirectoryName(group.Key));
                        Directory.SetCurrentDirectory(assemblyDirectory.FullName);
                        sandbox.Content.Execute(this, group.Select(t => t.FullyQualifiedName).ToArray());
                    }
                }
                catch (Exception ex)
                {
                    testLogger.SendErrorMessage(ex, String.Format("Exception found while executing tests in group '{0}'", group.Key));

                    // just go on with the next
                }
            }

            testLogger.SendMainMessage("Execution finished");
        }
Ejemplo n.º 2
0
        public void RunTests(IEnumerable <TestCase> tests, IRunContext runContext, IFrameworkHandle frameworkHandle)
        {
            this.frameworkHandle = frameworkHandle;

            var testLogger = new TestLogger(frameworkHandle);

            testLogger.SendMainMessage("Execution started");

            foreach (var group in tests.GroupBy(t => t.Source))
            {
                testLogger.SendInformationalMessage(String.Format("Running selected: '{0}'", group.Key));

                try
                {
                    using (var sandbox = new Sandbox <Executor>(group.Key))
                    {
                        sandbox.Content.Execute(this, group.Select(t => t.FullyQualifiedName).ToArray());
                    }
                }
                catch (Exception ex)
                {
                    testLogger.SendErrorMessage(ex, String.Format("Exception found while executing tests in group '{0}'", group.Key));

                    // just go on with the next
                }
            }

            testLogger.SendMainMessage("Execution finished");
        }
Ejemplo n.º 3
0
        public void RunTests(IEnumerable<string> sources, IRunContext runContext, IFrameworkHandle frameworkHandle)
        {
            this.frameworkHandle = frameworkHandle;

            var testLogger = new TestLogger(frameworkHandle);

            testLogger.SendMainMessage("Execution started");

            foreach (var source in sources)
            {
                try
                {
                    using (var sandbox = new Sandbox<Executor>(source))
                    {
                        testLogger.SendInformationalMessage(String.Format("Running: '{0}'", source));

                        var assemblyDirectory = new DirectoryInfo(Path.GetDirectoryName(source));
                        Directory.SetCurrentDirectory(assemblyDirectory.FullName);
                        sandbox.Content.Execute(this);
                    }
                }
                catch (Exception ex)
                {
                    testLogger.SendErrorMessage(ex, String.Format("Exception found while executing tests in source '{0}'", source));

                    // just go on with the next
                }
            }

            testLogger.SendMainMessage("Execution finished");
        }
Ejemplo n.º 4
0
        public void RunTests(IEnumerable <string> sources, IRunContext runContext, IFrameworkHandle frameworkHandle)
        {
            this.frameworkHandle = frameworkHandle;

            var testLogger = new TestLogger(frameworkHandle);

            testLogger.SendMainMessage("Execution started");

            foreach (var source in sources)
            {
                try
                {
                    using (var sandbox = new Sandbox <Executor>(source))
                    {
                        testLogger.SendInformationalMessage(String.Format("Running: '{0}'", source));

                        sandbox.Content.Execute(this);
                    }
                }
                catch (Exception ex)
                {
                    testLogger.SendErrorMessage(ex, String.Format("Exception found while executing tests in source '{0}'", source));

                    // just go on with the next
                }
            }

            testLogger.SendMainMessage("Execution finished");
        }