本文整理汇总了C#中TestFilter类的典型用法代码示例。如果您正苦于以下问题:C# TestFilter类的具体用法?C# TestFilter怎么用?C# TestFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TestFilter类属于命名空间,在下文中一共展示了TestFilter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateCompositePostTest
private static Test CreateCompositePostTest(TestFilter filter, params PostTest[] tests)
{
return new CompositePostTest(
(PostTest[])ArrayHelper.Narrow(
filter(tests),
typeof(PostTest)));
}
示例2: TestExecutionTask
public TestExecutionTask(ITestEngineRunner runner, ITestEventListener listener, TestFilter filter, bool disposeRunner)
{
_disposeRunner = disposeRunner;
_filter = filter;
_listener = listener;
_runner = runner;
}
示例3: TestCompositeFilterRemove
public void TestCompositeFilterRemove()
{
List<int> priorities = new List<int>();
ConsoleViewFilterBase filter1 = new TestFilter(1, delegate(ref ConsoleViewCellEntry e)
{
priorities.Add(1);
return true;
});
ConsoleViewFilterBase filter2 = new TestFilter(2, delegate(ref ConsoleViewCellEntry e)
{
priorities.Add(2);
return true;
});
ConsoleViewFilterBase filter3 = new TestFilter(3, delegate(ref ConsoleViewCellEntry e)
{
priorities.Add(3);
return true;
});
ConsoleViewCompositeFilter compositeFilter = new ConsoleViewCompositeFilter();
compositeFilter.AddFilter(filter1);
compositeFilter.AddFilter(filter2);
compositeFilter.AddFilter(filter3);
compositeFilter.RemoveFilter(filter1);
compositeFilter.RemoveFilter(filter3);
ConsoleViewCellEntry entry = default(ConsoleViewCellEntry);
compositeFilter.Apply(ref entry);
AssertList(priorities, 2);
}
示例4: runTests
private TestResult runTests(string nameSpace, TestFilter filter)
{
TestSuiteBuilder builder = new TestSuiteBuilder();
TestPackage package = new TestPackage( testAssembly );
package.TestName = nameSpace;
Test suite = builder.Build( package );
return suite.Run(new NullListener(),filter);
}
示例5: AssemblyRunner
// This constructor is called by the others and is used directly for testing
public AssemblyRunner(TestLogger logger, string assemblyName)
{
this.logger = logger;
this.assemblyName = assemblyName;
testConverter = new TestConverter(logger, assemblyName);
loadedTestCases = new List<TestCase>();
nunitFilter = TestFilter.Empty;
}
示例6: ExecuteTestSuite
private void ExecuteTestSuite( TestSuite suite, UnitTestRunner.ITestRunnerCallback testRunnerEventListener, TestFilter filter )
{
EventListener eventListener;
if (testRunnerEventListener == null)
eventListener = new NullListener ();
else
eventListener = new TestRunnerEventListener (testRunnerEventListener);
suite.Run(eventListener, GetFilter(filter));
}
示例7: Equals
public void Equals()
{
Base.EqualReferencesComparer e = new EqualReferencesComparer();
TestFilter a = new TestFilter();
TestFilter b = new TestFilter();
Assert.True(e.Equals(a, a));
Assert.True(e.Equals(b, b));
Assert.False(e.Equals(a, b));
}
示例8: ExploreTests
/// <summary>
/// Explore a TestPackage and return information about
/// the tests found.
/// </summary>
/// <param name="package">The TestPackage to be explored</param>
/// <returns>A TestEngineResult.</returns>
protected override TestEngineResult ExploreTests(TestFilter filter)
{
TestEngineResult result = new TestEngineResult();
foreach (IFrameworkDriver driver in _drivers)
result.Add(driver.Explore(filter));
return IsProjectPackage(this.TestPackage)
? result.MakePackageResult(TestPackage.Name, TestPackage.FullName)
: result;
}
示例9: ExploreTests
/// <summary>
/// Explore a TestPackage and return information about
/// the tests found.
/// </summary>
/// <param name="filter">A TestFilter used to select tests</param>
/// <returns>A TestEngineResult.</returns>
protected override TestEngineResult ExploreTests(TestFilter filter)
{
try
{
return _remoteRunner.Explore(filter);
}
catch (Exception e)
{
log.Error("Failed to run remote tests {0}", e.Message);
return CreateFailedResult(e);
}
}
示例10: ExploreTests
/// <summary>
/// Explores a previously loaded TestPackage and returns information
/// about the tests found.
/// </summary>
/// <param name="filter">The TestFilter to be used to select tests</param>
/// <returns>
/// A TestEngineResult.
/// </returns>
protected override TestEngineResult ExploreTests(TestFilter filter)
{
var result = new TestEngineResult();
foreach (IFrameworkDriver driver in _drivers)
result.Add(driver.Explore(filter.Text));
if (IsProjectPackage(TestPackage))
result = result.MakePackageResult(TestPackage.Name, TestPackage.FullName);
return result;
}
示例11: ExploreTests
/// <summary>
/// Explore a TestPackage and return information about
/// the tests found.
/// </summary>
/// <param name="filter">A TestFilter used to select tests</param>
/// <returns>A TestEngineResult.</returns>
protected override TestEngineResult ExploreTests(TestFilter filter)
{
var results = new List<TestEngineResult>();
foreach (ITestEngineRunner runner in _runners)
results.Add(runner.Explore(filter));
TestEngineResult result = ResultHelper.Merge(results);
return IsProjectPackage(TestPackage)
? result.MakePackageResult(TestPackage.Name, TestPackage.FullName)
: result;
}
示例12: CreateFilter
public override Task<Filter> CreateFilter(Message request)
{
TestFilter filter = null;
// resolve the "To" address as the matching entry
foreach (var f in services)
{
if (f.Service.Uri.AbsolutePath == request.Headers.To.AbsolutePath)
{
filter = new TestFilter();
filter.Initialize(request.Headers.To, new Uri[] { f.Uri });
break;
}
}
return Task.FromResult<Filter>(filter);
}
示例13: RunTests
public void RunTests(TestFilter filter, UnitTestRunner.ITestRunnerCallback testRunnerEventListener) {
try {
if (testRunnerEventListener != null)
{ testRunnerEventListener.RunStarted(testSuite.TestName.FullName, testSuite.TestCount); }
ExecuteTestSuite(testSuite, testRunnerEventListener, filter);
if (testRunnerEventListener != null)
{ testRunnerEventListener.RunFinished(); }
} catch (Exception e) {
Debug.LogException(e);
if (testRunnerEventListener != null)
{ testRunnerEventListener.RunFinishedException(e); }
}
}
示例14: AddTests
private static void AddTests(List<Test> tests, TestFilter filter)
{
// New tests go here
tests.AddRange(filter(
new SupportsMultipleCategoriesTest(),
new SupportsPostAsDraftTest(),
new SupportsFuturePostTest(),
new SupportsEmptyTitlesTest()
));
tests.Add(CreateCompositePostTest(filter,
new TitleEncodingTest(),
new SupportsEmbedsTest(),
new SupportsScriptsTest()
));
}
示例15: TestOperations
public void TestOperations()
{
// invalid operations
using (var filter = new FilterStream(CreateStream("test", true)))
{
AssertException(() => filter.Seek(0, SeekOrigin.Current));
AssertException(() => filter.Write(new Byte[10], 0, 10));
}
// filter read/write
using (var reader = new TestFilter(CreateStream("test")))
using (var writer = new TestFilter(new MemoryStream()))
{
reader.CopyTo(writer);
Assert.IsTrue(AreEqual(reader.Log, writer.Log));
}
using (var reader = new TestFilter(CreateStream(String.Join("", Enumerable.Repeat("123", 1000)))))
using (var writer = new TestFilter(new MemoryStream()))
{
reader.CopyTo(writer);
Assert.IsTrue(AreEqual(reader.Log, writer.Log));
}
// filter flush/dispose
using (var reader1 = new TestFilter(CreateStream("test")))
using (var reader2 = new FilterStream(reader1))
using (var writer1 = new TestFilter(new MemoryStream()))
using (var writer2 = new FilterStream(writer1))
{
reader2.CopyTo(writer2);
Assert.IsTrue(AreEqual(reader1.Log, writer1.Log));
Assert.IsFalse(writer1.Flushed);
writer2.Flush();
Assert.IsTrue(writer1.Flushed);
Assert.IsFalse(reader1.Disposed);
Assert.IsFalse(writer1.Disposed);
reader2.Dispose();
writer2.Dispose();
Assert.IsTrue(reader1.Disposed);
Assert.IsTrue(writer1.Disposed);
}
}