当前位置: 首页>>代码示例>>C#>>正文


C# TestFilter类代码示例

本文整理汇总了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)));
 }
开发者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


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