当前位置: 首页>>代码示例>>C#>>正文


C# Api.FrameworkController类代码示例

本文整理汇总了C#中NUnit.Framework.Api.FrameworkController的典型用法代码示例。如果您正苦于以下问题:C# FrameworkController类的具体用法?C# FrameworkController怎么用?C# FrameworkController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FrameworkController类属于NUnit.Framework.Api命名空间,在下文中一共展示了FrameworkController类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateController

        public void CreateController()
        {
#if PORTABLE || NETSTANDARD1_6
            _controller = new FrameworkController(typeof(MockAssembly).GetTypeInfo().Assembly, "ID", _settings);
#else
            _controller = new FrameworkController(MOCK_ASSEMBLY_PATH, "ID", _settings);
#endif
            _handler = new CallbackEventHandler();
        }
开发者ID:nunit,项目名称:nunit,代码行数:9,代码来源:FrameworkControllerTests.cs

示例2: CreateController

        public void CreateController()
        {
#if SILVERLIGHT
            _controller = new FrameworkController(MOCK_ASSEMBLY_NAME, "ID", _settings);
#else
            _controller = new FrameworkController(MOCK_ASSEMBLY_PATH, "ID", _settings);
#endif
            _handler = new CallbackEventHandler();
        }
开发者ID:JohanLarsson,项目名称:nunit,代码行数:9,代码来源:FrameworkControllerTests.cs

示例3: StopRunAction

 /// <summary>
 /// Construct a StopRunAction and stop any ongoing run. If no
 /// run is in process, no error is raised.
 /// </summary>
 /// <param name="controller">The FrameworkController for which a run is to be stopped.</param>
 /// <param name="force">True the stop should be forced, false for a cooperative stop.</param>
 /// <param name="handler">>A callback handler used to report results</param>
 /// <remarks>A forced stop will cause threads and processes to be killed as needed.</remarks>
 public StopRunAction(FrameworkController controller, bool force, object handler)
 {
     controller.StopRun((ICallbackEventHandler)handler, force);
 }
开发者ID:lundmikkel,项目名称:nunit,代码行数:12,代码来源:FrameworkController.cs

示例4: RunAsyncAction

 /// <summary>
 /// Construct a RunAsyncAction 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 RunAsyncAction(FrameworkController controller, string filter, object handler) 
 {
     controller.RunAsync((ICallbackEventHandler)handler, filter);
 }
开发者ID:lundmikkel,项目名称:nunit,代码行数:10,代码来源:FrameworkController.cs

示例5: CountTestsAction

 /// <summary>
 /// Construct a CountsTestAction and perform the count of test cases.
 /// </summary>
 /// <param name="controller">A FrameworkController holding the TestSuite whose cases are to be counted</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 CountTestsAction(FrameworkController controller, string filter, object handler) 
 {
     controller.CountTests((ICallbackEventHandler)handler, filter);
 }
开发者ID:lundmikkel,项目名称:nunit,代码行数:10,代码来源:FrameworkController.cs

示例6: LoadTestsAction

 /// <summary>
 /// LoadTestsAction loads the tests in an assembly.
 /// </summary>
 /// <param name="controller">The controller.</param>
 /// <param name="handler">The callback handler.</param>
 public LoadTestsAction(FrameworkController controller, object handler)
 {
     controller.LoadTests((ICallbackEventHandler)handler);
 }
开发者ID:lundmikkel,项目名称:nunit,代码行数:9,代码来源:FrameworkController.cs

示例7: RunAsyncAction_BadFile_ReturnsNonRunnableSuite

        public void RunAsyncAction_BadFile_ReturnsNonRunnableSuite()
        {
            var controller = new FrameworkController(BAD_FILE, "ID", _settings);
            new FrameworkController.LoadTestsAction(controller, _handler);
            new FrameworkController.RunAsyncAction(controller, EMPTY_FILTER, _handler);
            //var result = TNode.FromXml(_handler.GetCallbackResult());

            //Assert.That(result.Name.ToString(), Is.EqualTo("test-suite"));
            //Assert.That(result.Attributes["type"], Is.EqualTo("Assembly"));
            //Assert.That(result.Attributes["runstate"], Is.EqualTo("NotRunnable"));
            //Assert.That(result.Attributes["testcasecount"], Is.EqualTo("0"));
            // Minimal check here to allow for platform differences
            //Assert.That(GetSkipReason(result), Contains.Substring(BAD_FILE));
            //Assert.That(result.SelectNodes("test-suite").Count, Is.EqualTo(0), "Load result should not have child tests");
        }
开发者ID:nunit,项目名称:nunit,代码行数:15,代码来源:FrameworkControllerTests.cs

示例8: CountTestsAction_BadFile_ReturnsZero

 public void CountTestsAction_BadFile_ReturnsZero()
 {
     var controller = new FrameworkController(BAD_FILE, "ID", _settings);
     new FrameworkController.LoadTestsAction(controller, _handler);
     new FrameworkController.CountTestsAction(controller, EMPTY_FILTER, _handler);
     Assert.That(_handler.GetCallbackResult(), Is.EqualTo("0"));
 }
开发者ID:nunit,项目名称:nunit,代码行数:7,代码来源:FrameworkControllerTests.cs

示例9: LoadTestsAction_Assembly_ReturnsRunnableSuite

        public void LoadTestsAction_Assembly_ReturnsRunnableSuite()
        {
            _controller = new FrameworkController(typeof(MockAssembly).GetTypeInfo().Assembly, "ID", _settings);
            new FrameworkController.LoadTestsAction(_controller, _handler);
            var result = TNode.FromXml(_handler.GetCallbackResult());

            Assert.That(result.Name.ToString(), Is.EqualTo("test-suite"));
            Assert.That(result.Attributes["type"], Is.EqualTo("Assembly"));
            Assert.That(result.Attributes["id"], Is.Not.Null.And.StartWith("ID"));
            Assert.That(result.Attributes["name"], Is.EqualTo(EXPECTED_NAME).IgnoreCase);
            Assert.That(result.Attributes["runstate"], Is.EqualTo("Runnable"));
            Assert.That(result.Attributes["testcasecount"], Is.EqualTo(MockAssembly.Tests.ToString()));
            Assert.That(result.SelectNodes("test-suite").Count, Is.EqualTo(0), "Load result should not have child tests");
        }
开发者ID:nunit,项目名称:nunit,代码行数:14,代码来源:FrameworkControllerTests.cs

示例10: CreateController

 public void CreateController()
 {
     _mockAssemblyPath = Path.Combine(TestContext.CurrentContext.TestDirectory, MOCK_ASSEMBLY);
     _controller = new FrameworkController(_mockAssemblyPath, _settings);
     _handler = new CallbackEventHandler();
 }
开发者ID:balaghanta,项目名称:nunit-framework,代码行数:6,代码来源:FrameworkControllerTests.cs

示例11: RunAsyncAction_BadFile_ReturnsNonRunnableSuite

        public void RunAsyncAction_BadFile_ReturnsNonRunnableSuite()
        {
            var controller = new FrameworkController(BAD_FILE, _settings);
            new FrameworkController.LoadTestsAction(controller, _handler);
            new FrameworkController.RunAsyncAction(controller, EMPTY_FILTER, _handler);
            //var result = GetXmlResult();

            //Assert.That(result.Name, Is.EqualTo("test-suite"));
            //Assert.That(GetAttribute(result, "type"), Is.EqualTo("Assembly"));
            //Assert.That(GetAttribute(result, "runstate"), Is.EqualTo("NotRunnable"));
            //Assert.That(GetAttribute(result, "testcasecount"), Is.EqualTo("0"));
            //Assert.That(GetSkipReason(result), Does.StartWith("Could not load").And.Contains(BAD_FILE));
            //Assert.That(result.SelectNodes("test-suite").Count, Is.EqualTo(0), "Load result should not have child tests");
        }
开发者ID:balaghanta,项目名称:nunit-framework,代码行数:14,代码来源:FrameworkControllerTests.cs

示例12: ExploreTestsAction_FileNotFound_ReturnsNonRunnableSuite

        public void ExploreTestsAction_FileNotFound_ReturnsNonRunnableSuite()
        {
            var controller = new FrameworkController(MISSING_FILE, _settings);
            new FrameworkController.LoadTestsAction(controller, _handler);
            new FrameworkController.ExploreTestsAction(controller, EMPTY_FILTER, _handler);
            var result = GetXmlResult();

            Assert.That(result.Name, Is.EqualTo("test-suite"));
            Assert.That(GetAttribute(result, "type"), Is.EqualTo("Assembly"));
            Assert.That(GetAttribute(result, "runstate"), Is.EqualTo("NotRunnable"));
            Assert.That(GetAttribute(result, "testcasecount"), Is.EqualTo("0"));
            Assert.That(GetSkipReason(result), Is.StringStarting("Could not load").And.Contains(MISSING_FILE));
            Assert.That(result.SelectNodes("test-suite").Count, Is.EqualTo(0), "Result should not have child tests");
        }
开发者ID:TannerBaldus,项目名称:test_accelerator,代码行数:14,代码来源:FrameworkControllerTests.cs


注:本文中的NUnit.Framework.Api.FrameworkController类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。