RunTests() public method

Runs the tests in an assembly synchronously reporting back the test results through the callback or through the return value
public RunTests ( Action callback, string filter ) : string
callback Action The callback that receives the test results
filter string A string containing the XML representation of the filter to use
return string
示例#1
0
        public static void TestResultSchemaMatches()
        {
            Assert.Multiple(() =>
            {
                var controller = new FrameworkController("mock-assembly", Test.IdPrefix, new Dictionary <string, string>());
                controller.LoadTests();

                var frameworkXml = XElement.Parse(controller.RunTests(null));

                var fullXml = new XElement("test-run",
                                           new XElement("command-line"),
                                           new XElement("filter"),
                                           frameworkXml,
                                           new XAttribute("id", 0),
                                           new XAttribute("name", 0),
                                           new XAttribute("fullname", 0),
                                           new XAttribute("testcasecount", 0),
                                           new XAttribute("result", "Passed"),
                                           new XAttribute("total", 0),
                                           new XAttribute("passed", 0),
                                           new XAttribute("failed", 0),
                                           new XAttribute("inconclusive", 0),
                                           new XAttribute("skipped", 0),
                                           new XAttribute("warnings", 0),
                                           new XAttribute("asserts", 0),
                                           new XAttribute("random-seed", 0));

                SchemaTestUtils.AssertValidXml(fullXml.ToString(), "TestResult.xsd");
            });
        }
示例#2
0
 /// <summary>
 /// Construct a RunTestsAction and run all tests in the loaded TestSuite.
 /// </summary>
 /// <param name="controller">A FrameworkController holding the TestSuite to run</param>
 /// <param name="filter">A string containing the XML representation of the filter to use</param>
 /// <param name="handler">A callback handler used to report results</param>
 public RunTestsAction(FrameworkController controller, string filter, object handler)
 {
     controller.RunTests((ICallbackEventHandler)handler, filter);
 }
示例#3
0
 /// <summary>
 /// Construct a RunTestsAction and run all tests in the loaded TestSuite.
 /// </summary>
 /// <param name="controller">A FrameworkController holding the TestSuite to run</param>
 /// <param name="filter">A string containing the XML representation of the filter to use</param>
 /// <param name="handler">A callback handler used to report results</param>
 public RunTestsAction(FrameworkController controller, string filter, object handler) 
 {
     controller.RunTests((ICallbackEventHandler)handler, filter);
 }