Exemplo n.º 1
0
            public void RunTests(string assemblyName, string[] testNames, string explictlyIncluding, ITestResultListener listener)
            {
                using(var nativeTestFactory = RunTestDiscovery(Assembly.Load(assemblyName), t => true))
                {
                    foreach(var name in testNames)
                    {
                        var testContext = nativeTestFactory.Contexts[name];

                        var ignoreReason = nativeTestFactory.GetIgnoreReason(name, explictlyIncluding);

                        listener.NotifyStart(testContext.Name.FullName);

                        List<string> traceMessages = new List<string>();

                        if (ignoreReason == null)
                        {
                            var result = SpecificationRunner.RunTest(testContext, traceMessages);

                            listener.NotifyEnd(testContext.Name.FullName, result);
                        }
                        else
                        {
                            var result = new TestResultShim();
                            result.SetSkipped(ignoreReason);
                            listener.NotifyEnd(testContext.Name.FullName, result);
                        }
                    }
                }
            }