本文整理汇总了C#中AutoTest.TestRunners.Shared.Options.RunSettings类的典型用法代码示例。如果您正苦于以下问题:C# RunSettings类的具体用法?C# RunSettings怎么用?C# RunSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RunSettings类属于AutoTest.TestRunners.Shared.Options命名空间,在下文中一共展示了RunSettings类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: RunSettings
public void and_a_namespace_is_specified_it_should_only_run_tests_contained_by_these_namespaces_and_all_sub_namespaces()
{
// Note that the namespaces varies between MbUnit.Tests and MbUnitTests.Tests
var settings = new RunSettings(new AssemblyOptions(getAssembly()), new string[] { }, null);
settings.Assembly.AddNamespace("AutoTest.TestRunners.MbUnit.Tests.TestResource");
Assert.That(_runner.Run(settings).Count(), Is.EqualTo(1));
}
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:7,代码来源:CanRunTests.cs
示例2: Should_run_all_tests
public void Should_run_all_tests()
{
var settings = new RunSettings(new AssemblyOptions(Path.GetFullPath(@"AutoTest.TestRunners.MSTest.Tests.TestResource.dll")), new string[] {}, null);
var runner = new Runner();
var result = runner.Run(settings);
Assert.That(result.Count(), Is.EqualTo(10));
}
开发者ID:JamesTryand,项目名称:AutoTest.Net,代码行数:7,代码来源:RunnerTests.cs
示例3: Run
public IEnumerable<TestResult> Run(Plugin plugin, string id, RunSettings settings)
{
_directories.Add(Path.GetDirectoryName(settings.Assembly.Assembly));
_directories.Add(Path.GetDirectoryName(plugin.Assembly));
Logger.Write("About to create plugin {0} in {1} for {2}", plugin.Type, plugin.Assembly, id);
var runner = getRunner(plugin);
try
{
if (runner == null)
return _results;
Logger.Write("Matching plugin identifier ({0}) to test identifier ({1})", runner.Identifier, id);
if (!runner.Identifier.ToLower().Equals(id.ToLower()))
return _results;
Logger.Write("Checking whether assembly contains tests for {0}", id);
if (!runner.ContainsTestsFor(settings.Assembly.Assembly))
return _results;
Logger.Write("Starting test run");
return runner.Run(settings);
}
catch
{
throw;
}
finally
{
AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve;
}
}
开发者ID:gtejeda,项目名称:AutoTest.Net,代码行数:28,代码来源:TestRunner.cs
示例4: and_a_test_is_specified_it_should_only_run_specified_tests
public void and_a_test_is_specified_it_should_only_run_specified_tests()
{
var settings = new RunSettings(new AssemblyOptions(getAssembly()), new string[] { }, null);
settings.Assembly.AddTest("AutoTest.TestRunners.MbUnitTests.Tests.TestResource.ClassContainingTests.A_passing_test");
settings.Assembly.AddTest("AutoTest.TestRunners.MbUnitTests.Tests.TestResource.ClassContainingTests.A_failing_test");
Assert.That(_runner.Run(settings).Count(), Is.EqualTo(2));
}
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:7,代码来源:CanRunTests.cs
示例5: When_told_to_run_all_tests_it_reports_all_tests
public void When_told_to_run_all_tests_it_reports_all_tests()
{
var runner = new Runner();
var options = new AssemblyOptions(getAssembly());
var settings = new RunSettings(options, new string[] { }, null);
var result = runner.Run(settings);
Assert.That(result.Count(), Is.EqualTo(5));
}
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:8,代码来源:Can_recognize_simpletesting.cs
示例6: and_a_namespace_is_specified_it_should_only_run_tests_contained_by_these_namespaces
public void and_a_namespace_is_specified_it_should_only_run_tests_contained_by_these_namespaces()
{
var settings = new RunSettings(new AssemblyOptions(getAssembly()), new string[] { }, null);
settings.Assembly.AddNamespace("AutoTest.TestRunners.MbUnit.Tests.TestResource.AnotherNamespace");
Assert.That(_runner.Run(settings).Count(), Is.EqualTo(1));
Assert.That(_runner.Run(settings).ElementAt(0).TestName,
Is.EqualTo("AutoTest.TestRunners.MbUnit.Tests.TestResource.AnotherNamespace.TestsInAnotherNamespace.Even_another_test"));
}
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:8,代码来源:CanRunTests.cs
示例7: when_told_to_run_all_on_type_it_runs_all_on_type
public void when_told_to_run_all_on_type_it_runs_all_on_type()
{
var runner = new Runner();
var options = new AssemblyOptions(getAssembly());
options.AddMember("AutoTest.TestRunners.SimpleTesting.Tests.Resources.SimpleTestingTests");
var settings = new RunSettings(options, new string[] { }, null);
var result = runner.Run(settings);
Assert.That(result.Count(), Is.EqualTo(3));
}
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:9,代码来源:Can_recognize_simpletesting.cs
示例8: Run
public IEnumerable<TestResult> Run(RunSettings settings)
{
_results = new List<TestResult>();
var thread = new Thread(run);
thread.SetApartmentState(ApartmentState.STA);
thread.Start(settings);
thread.Join();
return _results;
}
开发者ID:gtejeda,项目名称:AutoTest.Net,代码行数:9,代码来源:CelerRunner.cs
示例9: Should_not_run_test_with_ignore_attribute
public void Should_not_run_test_with_ignore_attribute()
{
var assemblyPath = Path.GetFullPath(@"AutoTest.TestRunners.MSTest.Tests.TestResource.dll");
var assembly = new AssemblyOptions(assemblyPath);
assembly.AddTest("AutoTest.TestRunners.MSTest.Tests.TestResource.TestFixture1.Ignore_Attrib_test");
var settings = new RunSettings(assembly, new string[] { }, null);
var runner = new Runner();
var result = runner.Run(settings);
Assert.That(result.Count(), Is.EqualTo(0));
}
开发者ID:JamesTryand,项目名称:AutoTest.Net,代码行数:10,代码来源:RunnerTests.cs
示例10: Run
public IEnumerable<TestResult> Run(RunSettings settings)
{
_results = new List<TestResult>();
var listener = new TestListener(_feedback, settings.Assembly.Assembly);
var assembly = getAssembly(settings.Assembly.Assembly);
var runner = new AppDomainRunner(listener, Machine.Specifications.Runner.RunOptions.Default);
runTests(settings, assembly, runner);
_results.AddRange(listener.Results);
return _results;
}
开发者ID:JamesTryand,项目名称:AutoTest.Net,代码行数:10,代码来源:Runner.cs
示例11: Run
public IEnumerable<TestResult> Run(RunSettings settings)
{
var runner = new NUnitRunner();
runner.Initialize();
var parser = new NUnitOptionsParser(settings);
parser.Parse();
var results = new List<TestResult>();
foreach (var option in parser.Options)
results.AddRange(runner.Execute(option));
return results;
}
开发者ID:gtejeda,项目名称:AutoTest.Net,代码行数:11,代码来源:Runner.cs
示例12: shouldRun
private static bool shouldRun(string methodName, RunSettings settings)
{
var assembly = settings.Assembly;
if (assembly.Tests.Contains(methodName))
return true;
if (assembly.Members.Any(x => methodName.StartsWith(x)))
return true;
if (assembly.Namespaces.Any(x => methodName.StartsWith(x)))
return true;
return false;
}
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:11,代码来源:TypeExtensions.cs
示例13: runTests
private void runTests(RunSettings settings, IGrouping<Type, MethodInfo> fixture)
{
log("Running fixture {0}", fixture.Key);
if (_channel != null)
_channel.TestStarted(fixture.Key.ToString());
new MSTestTestFixture(fixture.Key)
.Run(fixture.ToList()).ToList()
.ForEach(result =>
{
var item = getResult(settings, fixture, result);
_results.Add(item);
_channel.TestFinished(item);
});
}
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:14,代码来源:CelerRunner.cs
示例14: and_it_passes_it_should_return_passing_result
public void and_it_passes_it_should_return_passing_result()
{
var settings = new RunSettings(new AssemblyOptions(getAssembly()), new string[] { }, null);
settings.Assembly.AddTest("AutoTest.TestRunners.MbUnitTests.Tests.TestResource.ClassContainingTests.A_passing_test");
var result = _runner.Run(settings);
var test = result.ElementAt(0);
Assert.That(test.Assembly, Is.EqualTo(getAssembly()));
Assert.That(test.DurationInMilliseconds, Is.GreaterThan(0));
Assert.That(test.Runner, Is.EqualTo("MbUnit"));
Assert.That(test.State, Is.EqualTo(Shared.Results.TestState.Passed));
Assert.That(test.TestFixture, Is.EqualTo("AutoTest.TestRunners.MbUnitTests.Tests.TestResource.ClassContainingTests"));
Assert.That(test.TestName, Is.EqualTo("AutoTest.TestRunners.MbUnitTests.Tests.TestResource.ClassContainingTests.A_passing_test"));
}
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:14,代码来源:CanRunTests.cs
示例15: runTests
private void runTests(RunSettings settings, Assembly assembly, AppDomainRunner runner)
{
if (runAllTests(settings))
{
runner.RunAssembly(assembly);
return;
}
foreach (var member in settings.Assembly.Tests)
runner.RunMember(assembly, assembly.GetType(member));
foreach (var member in settings.Assembly.Members)
runner.RunMember(assembly, assembly.GetType(member));
foreach (var ns in settings.Assembly.Namespaces)
runner.RunNamespace(assembly, ns);
}
开发者ID:JamesTryand,项目名称:AutoTest.Net,代码行数:14,代码来源:Runner.cs
示例16: Should_run_full_fixture
public void Should_run_full_fixture()
{
var assemblyPath = Path.GetFullPath(@"AutoTest.TestRunners.MSTest.Tests.TestResource.dll");
var assembly = new AssemblyOptions(assemblyPath);
assembly.AddMember("AutoTest.TestRunners.MSTest.Tests.TestResource.TestFixture2");
var settings = new RunSettings(assembly, new string[] { });
var runner = new Runner();
var result = runner.Run(settings);
Assert.That(result.Count(), Is.EqualTo(2));
var test = result.ElementAt(0);
Assert.That(test.TestFixture, Is.EqualTo("AutoTest.TestRunners.MSTest.Tests.TestResource.TestFixture2"));
Assert.That(test.TestName, Is.EqualTo("AutoTest.TestRunners.MSTest.Tests.TestResource.TestFixture2.Another_passing_test"));
Assert.That(result.ElementAt(1).TestFixture, Is.EqualTo("AutoTest.TestRunners.MSTest.Tests.TestResource.TestFixture2"));
}
开发者ID:gtejeda,项目名称:AutoTest.Net,代码行数:15,代码来源:RunnerTests.cs
示例17: When_told_to_run_a_test_that_is_ignored_it_reports_a_ignored_result
public void When_told_to_run_a_test_that_is_ignored_it_reports_a_ignored_result()
{
var runner = new Runner();
var options = new AssemblyOptions(getAssembly());
options.AddTest("AutoTest.TestRunners.MSpec.Tests.TestResource.Ignored_test");
var settings = new RunSettings(options, new string[] { }, null);
var result = runner.Run(settings);
Assert.That(result.Count(), Is.EqualTo(1));
var test = result.ElementAt(0);
Assert.That(test.State, Is.EqualTo(Shared.Results.TestState.Ignored));
Assert.That(test.Assembly, Is.EqualTo(getAssembly()));
Assert.That(test.Runner, Is.EqualTo("MSpec"));
Assert.That(test.TestFixture, Is.EqualTo("AutoTest.TestRunners.MSpec.Tests.TestResource.Ignored_test"));
Assert.That(test.TestName, Is.EqualTo("AutoTest.TestRunners.MSpec.Tests.TestResource.Ignored_test"));
}
开发者ID:JamesTryand,项目名称:AutoTest.Net,代码行数:15,代码来源:Can_recognize_mspec.cs
示例18: when_running_named_test_that_passes
public void when_running_named_test_that_passes()
{
var runner = new Runner();
var options = new AssemblyOptions(getAssembly());
options.AddTest("AutoTest.TestRunners.SimpleTesting.Tests.Resources.SimpleTestingTests.a_passing_test");
var settings = new RunSettings(options, new string[] { }, null);
var result = runner.Run(settings);
Assert.That(result.Count(), Is.EqualTo(1));
Assert.That(result.First().State == TestState.Passed);
Assert.That(!result.First().StackLines.Any());
Assert.That(result.First().TestDisplayName == "a_passing_test");
Assert.That(result.First().Runner == "SimpleTesting");
Assert.AreEqual("AutoTest.TestRunners.SimpleTesting.Tests.Resources.SimpleTestingTests.a_passing_test", result.First().TestName);
Assert.AreEqual("SimpleTestingTests", result.First().TestFixture);
}
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:15,代码来源:Can_recognize_simpletesting.cs
示例19: runTests
private void runTests(RunSettings settings, IGrouping<Type, MethodInfo> fixture)
{
var list = fixture.ToList();
try
{
_logger.Write("Running fixture {0}", fixture.Key);
using (var runner = new MSTestTestRunner(fixture.Key))
{
list.Select(test => runner.Run(test)).ToList().ForEach(x => _results.Add(getResult(settings, fixture, x)));
}
}
catch (Exception ex)
{
list.ForEach(test => _results.Add(getResult(settings, fixture, new celer.Core.RunResult(test, false, false, ex, 0))));
}
}
开发者ID:gtejeda,项目名称:AutoTest.Net,代码行数:16,代码来源:CelerRunner.cs
示例20: Should_run_single_failing_test
public void Should_run_single_failing_test()
{
var assemblyPath = Path.GetFullPath(@"AutoTest.TestRunners.MSTest.Tests.TestResource.dll");
var assembly = new AssemblyOptions(assemblyPath);
assembly.AddTest("AutoTest.TestRunners.MSTest.Tests.TestResource.TestFixture1.Failing_test");
var settings = new RunSettings(assembly, new string[] { }, null);
var runner = new Runner();
var result = runner.Run(settings);
Assert.That(result.Count(), Is.EqualTo(1));
var test = result.ElementAt(0);
Assert.That(test.Runner, Is.EqualTo("MSTest"));
Assert.That(test.Assembly, Is.EqualTo(assemblyPath));
Assert.That(test.State, Is.EqualTo(Shared.Results.TestState.Failed));
Assert.That(test.TestFixture, Is.EqualTo("AutoTest.TestRunners.MSTest.Tests.TestResource.TestFixture1"));
Assert.That(test.TestName, Is.EqualTo("AutoTest.TestRunners.MSTest.Tests.TestResource.TestFixture1.Failing_test"));
}
开发者ID:JamesTryand,项目名称:AutoTest.Net,代码行数:16,代码来源:RunnerTests.cs
注:本文中的AutoTest.TestRunners.Shared.Options.RunSettings类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论