本文整理汇总了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();
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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");
}
示例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"));
}
示例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");
}
示例10: CreateController
public void CreateController()
{
_mockAssemblyPath = Path.Combine(TestContext.CurrentContext.TestDirectory, MOCK_ASSEMBLY);
_controller = new FrameworkController(_mockAssemblyPath, _settings);
_handler = new CallbackEventHandler();
}
示例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");
}
示例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");
}