public ITestResultAssembly run(ITestResultFactory resultFactory, string testAssemblyPath, Assembly testAssembly)
        {
            // http://blogs.msdn.com/b/suzcook/archive/2003/05/29/choosing-a-binding-context.aspx#57147
            // LoadFrom differs from Load in that dependent assemblies can be resolved outside from the
            // BasePath.

            try
            {
                var drawingBackendType = tryLocateDrawingBackend(testAssembly);
                if (drawingBackendType == null)
                    throw new Exception("Missing [DrawingBackend] attribute. Please add [assembly:DrawingBackend] to your test assembly.");

                using (var drawingBackend = (IDrawingBackend)Activator.CreateInstance(drawingBackendType))
                {
                    TimeSpan time;
                    var classes = Measure.RunningTime(out time,
                        () => run(resultFactory, drawingBackend, testAssembly));
                    return resultFactory.Assembly(testAssemblyPath, classes, time);
                }
            }
            catch (Exception e)
            {
                return resultFactory.Assembly(testAssemblyPath, e);
            }
        }
Beispiel #2
0
        public ITestResultAssembly run(ITestResultFactory resultFactory, string testAssemblyPath, Assembly testAssembly)
        {
            // http://blogs.msdn.com/b/suzcook/archive/2003/05/29/choosing-a-binding-context.aspx#57147
            // LoadFrom differs from Load in that dependent assemblies can be resolved outside from the
            // BasePath.

            try
            {
                var drawingBackendType = tryLocateDrawingBackend(testAssembly);
                if (drawingBackendType == null)
                {
                    throw new Exception("Missing [DrawingBackend] attribute. Please add [assembly:DrawingBackend] to your test assembly.");
                }

                using (var drawingBackend = (IDrawingBackend)Activator.CreateInstance(drawingBackendType))
                {
                    TimeSpan time;
                    var      classes = Measure.RunningTime(out time,
                                                           () => run(resultFactory, drawingBackend, testAssembly));
                    return(resultFactory.Assembly(testAssemblyPath, classes, time));
                }
            }
            catch (Exception e)
            {
                return(resultFactory.Assembly(testAssemblyPath, e));
            }
        }