本文整理汇总了C#中AutoTest.Core.Messaging.MessageConsumers.TestRunInfo.AddTestsToRun方法的典型用法代码示例。如果您正苦于以下问题:C# TestRunInfo.AddTestsToRun方法的具体用法?C# TestRunInfo.AddTestsToRun怎么用?C# TestRunInfo.AddTestsToRun使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AutoTest.Core.Messaging.MessageConsumers.TestRunInfo
的用法示例。
在下文中一共展示了TestRunInfo.AddTestsToRun方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CloneToTestRunInfo
public TestRunInfo CloneToTestRunInfo()
{
var runInfo = new TestRunInfo(Project, Assembly);
runInfo.AddTestsToRun(GetTests());
foreach (var runner in _onlyRunTestsFor)
runInfo.ShouldOnlyRunSpcifiedTestsFor(runner);
foreach (var runner in _rerunAllWhenFinishedFor)
runInfo.ShouldRerunAllTestWhenFinishedFor(runner);
return runInfo;
}
示例2: Should_create_a_filter_file_when_tests_to_run_are_specified
public void Should_create_a_filter_file_when_tests_to_run_are_specified()
{
var document = new ProjectDocument(ProjectType.CSharp);
document.SetFramework("framework 1");
var info = new TestRunInfo(new Project("key 1", document), "assembly 1");
info.AddTestsToRun(new[]
{
new TestToRun(TestRunner.MSpec, "test 1"),
new TestToRun(TestRunner.MSpec, "test 2")
});
var infos = new[] { info };
var run = new MSpecTestRunner.Run { RunInfos = infos };
var args = _builder.Build(run);
Assert.That(args, Is.StringContaining("--filter"));
Assert.That(run.Cleanups.Count(), Is.EqualTo(2), "Should contain cleanup for XML report and filter");
}
示例3: Should_run_tests_for_each_framework_with_an_existing_runner
public void Should_run_tests_for_each_framework_with_an_existing_runner()
{
_configuration
.Stub(x => x.MSpecTestRunner("framework 1"))
.Return("c:\\runner 1.exe");
_configuration
.Stub(x => x.MSpecTestRunner("framework 2"))
.Return("c:\\runner 2.exe");
_fileSystem
.Stub(x => x.FileExists("c:\\runner 2.exe"))
.Return(true);
var document1 = new ProjectDocument(ProjectType.CSharp);
document1.SetFramework("framework 1");
var info1 = new TestRunInfo(new Project("key 1", document1), "assembly 1");
var document2 = new ProjectDocument(ProjectType.CSharp);
document2.SetFramework("framework 2");
var info2 = new TestRunInfo(new Project("key 2", document2), "assembly 2");
info2.AddTestsToRun(new[]
{
new TestToRun(TestRunner.MSpec, "test 1"),
});
var testRunInfos = new[] { info1, info2 };
_runner.RunTests(testRunInfos, null);
_externalProcess.AssertWasNotCalled(
x => x.CreateAndWaitForExit(Arg<string>.Matches(y => y == "c:\\runner 1.exe"),
Arg<string>.Is.Anything));
_externalProcess.AssertWasCalled(
x => x.CreateAndWaitForExit(Arg<string>.Matches(y => y == "c:\\runner 2.exe"),
Arg<string>.Is.Anything));
}