• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TestFilter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: CreateCompositePostTest

 private static Test CreateCompositePostTest(TestFilter filter, params PostTest[] tests)
 {
     return new CompositePostTest(
         (PostTest[])ArrayHelper.Narrow(
                          filter(tests),
                          typeof(PostTest)));
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:7,代码来源:Program.cs


示例2: TestExecutionTask

 public TestExecutionTask(ITestEngineRunner runner, ITestEventListener listener, TestFilter filter, bool disposeRunner)
 {
     _disposeRunner = disposeRunner;
     _filter = filter;
     _listener = listener;
     _runner = runner;
 }
开发者ID:alfeg,项目名称:nunit,代码行数:7,代码来源:TestExecutionTask.cs


示例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);
        }
开发者ID:oivoodoo,项目名称:lunar-unity-plugin,代码行数:35,代码来源:ConsoleViewTest.Filtering.cs


示例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);
        }
开发者ID:Buildstarted,项目名称:ContinuousTests,代码行数:8,代码来源:SetUpFixtureTests.cs


示例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;
 }
开发者ID:kukubadze,项目名称:nunit-vs-adapter,代码行数:9,代码来源:AssemblyRunner.cs


示例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));
 }
开发者ID:NoxHarmonium,项目名称:unity-tools,代码行数:9,代码来源:NUnitBasicTestEngine.cs


示例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));
        }
开发者ID:qida,项目名称:qcv,代码行数:11,代码来源:EqualReferencesComparerTest.cs


示例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;
        }
开发者ID:balaghanta,项目名称:nunit-framework,代码行数:17,代码来源:DirectTestRunner.cs


示例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);
     }
 }
开发者ID:nahugrau,项目名称:nunit,代码行数:18,代码来源:ProcessRunner.cs


示例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;
        }
开发者ID:alfeg,项目名称:nunit,代码行数:20,代码来源:DirectTestRunner.cs


示例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;
        }
开发者ID:ChrisMaddock,项目名称:nunit,代码行数:19,代码来源:AggregatingTestRunner.cs


示例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);
        }
开发者ID:zbrad,项目名称:WcfLib,代码行数:16,代码来源:TestResolver.cs


示例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); }
            }
        }
开发者ID:675492062,项目名称:behaviac,代码行数:17,代码来源:NUnitTestEngine.cs


示例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()
                ));
        }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:17,代码来源:Program.cs


示例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);
      }
 }
开发者ID:bspell1,项目名称:SkyFloe,代码行数:40,代码来源:TestFilterStream.cs


示例16: Run

 /// <summary>
 /// Run the tests in the TestPackage, loading the package
 /// if this has not already been done.
 /// </summary>
 /// <param name="listener">An ITestEventHandler to receive events</param>
 /// <param name="filter">A TestFilter used to select tests</param>
 /// <returns>A TestEngineResult giving the result of the test execution</returns>
 public TestEngineResult Run(ITestEventListener listener, TestFilter filter)
 {
     return RunTests(listener, filter);
 }
开发者ID:ChrisMaddock,项目名称:nunit,代码行数:11,代码来源:AbstractTestRunner.cs


示例17: CountTestCases

 /// <summary>
 /// Count the test cases that would be run under the specified
 /// filter, loading the TestPackage if it is not already loaded.
 /// </summary>
 /// <param name="filter">A TestFilter</param>
 /// <returns>The count of test cases.</returns>
 public int CountTestCases(TestFilter filter)
 {
     return CountTests(filter);
 }
开发者ID:ChrisMaddock,项目名称:nunit,代码行数:10,代码来源:AbstractTestRunner.cs


示例18: Explore

 /// <summary>
 /// Explores the TestPackage and returns information about
 /// the tests found. Loads the package if not done previously.
 /// </summary>
 /// <param name="filter">The TestFilter to be used to select tests</param>
 /// <returns>A TestEngineResult.</returns>
 public TestEngineResult Explore(TestFilter filter)
 {
     return ExploreTests(filter);
 }
开发者ID:ChrisMaddock,项目名称:nunit,代码行数:10,代码来源:AbstractTestRunner.cs


示例19: RunTestsAsync

        /// <summary>
        /// Start a run of the tests in the loaded TestPackage, returning immediately.
        /// The tests are run asynchronously and the listener interface is notified 
        /// as it progresses.
        /// </summary>
        /// <param name="listener">An ITestEventHandler to receive events</param>
        /// <param name="filter">A TestFilter used to select tests</param>
        /// <returns>An <see cref="AsyncTestEngineResult"/> that will provide the result of the test execution</returns>
        protected virtual AsyncTestEngineResult RunTestsAsync(ITestEventListener listener, TestFilter filter)
        {
            var testRun = new AsyncTestEngineResult();

            using (var worker = new BackgroundWorker())
            {
                worker.DoWork += (s, ea) =>
                {
                    var result = RunTests(listener, filter);
                    testRun.SetResult(result);
                };
                worker.RunWorkerAsync();
            }

            return testRun;
        }
开发者ID:ChrisMaddock,项目名称:nunit,代码行数:24,代码来源:AbstractTestRunner.cs


示例20: RunTests

 /// <summary>
 /// Run the tests in the loaded TestPackage.
 /// </summary>
 /// <param name="listener">An ITestEventHandler to receive events</param>
 /// <param name="filter">A TestFilter used to select tests</param>
 /// <returns>A TestEngineResult giving the result of the test execution</returns>
 protected abstract TestEngineResult RunTests(ITestEventListener listener, TestFilter filter);
开发者ID:ChrisMaddock,项目名称:nunit,代码行数:7,代码来源:AbstractTestRunner.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TestFrameWork类代码示例发布时间:2022-05-24
下一篇:
C# TestExecutionContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap