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


C# Matcher类代码示例

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


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

示例1: AssumptionViolatedException

 public AssumptionViolatedException(object value, Matcher matcher)
 {
   base.\u002Ector(!(value is Exception) ? (Exception) null : (Exception) value);
   AssumptionViolatedException violatedException = this;
   this.fValue = value;
   this.fMatcher = matcher;
 }
开发者ID:NALSS,项目名称:SmartDashboard.NET,代码行数:7,代码来源:AssumptionViolatedException.cs

示例2: FolderExclude

        public void FolderExclude()
        {
            var matcher = new Matcher();
            matcher.AddInclude(@"**/*.*");
            matcher.AddExclude(@"obj");
            matcher.AddExclude(@"bin");
            matcher.AddExclude(@".*");

            ExecuteAndVerify(matcher, @"src/project",
                "src/project/source1.cs",
                "src/project/sub/source2.cs",
                "src/project/sub/source3.cs",
                "src/project/sub2/source4.cs",
                "src/project/sub2/source5.cs",
                "src/project/compiler/preprocess/preprocess-source1.cs",
                "src/project/compiler/preprocess/sub/preprocess-source2.cs",
                "src/project/compiler/preprocess/sub/sub/preprocess-source3.cs",
                "src/project/compiler/preprocess/sub/sub/preprocess-source3.txt",
                "src/project/compiler/shared/shared1.cs",
                "src/project/compiler/shared/shared1.txt",
                "src/project/compiler/shared/sub/shared2.cs",
                "src/project/compiler/shared/sub/shared2.txt",
                "src/project/compiler/shared/sub/sub/sharedsub.cs",
                "src/project/compiler/resources/resource.res",
                "src/project/compiler/resources/sub/resource2.res",
                "src/project/compiler/resources/sub/sub/resource3.res",
                "src/project/content1.txt");
        }
开发者ID:sujiantao,项目名称:FileSystem,代码行数:28,代码来源:FunctionalTests.cs

示例3: That

 public static void That(object actual, Matcher matcher)
 {
     if (!matcher.Match(actual))
     {
         throw new ExpectationException(matcher.FailureMessage);
     }
 }
开发者ID:ashmoran,项目名称:c-sharp-test-framework,代码行数:7,代码来源:Expect.cs

示例4: IncludeCaseInsensitive

        public void IncludeCaseInsensitive(string root, string includePattern, string[] expectedFiles)
        {
            var matcher = new Matcher(StringComparison.OrdinalIgnoreCase);
            matcher.AddInclude(includePattern);

            ExecuteAndVerify(matcher, root, expectedFiles.Select(f => root + "/" + f).ToArray());
        }
开发者ID:leloulight,项目名称:FileSystem,代码行数:7,代码来源:FunctionalTests.cs

示例5: RegexCaseMatch

        public void RegexCaseMatch()
        {
            var match = new Matcher<string, string>
            {
                { Case.Rx(new Regex("\\d{3}")), s => "Success" }
            }.ToFunc();

            Assert.Equal("Success", match("123"));
        }
开发者ID:danslapman,项目名称:PatternMatching,代码行数:9,代码来源:MatcherTests.cs

示例6: assumeThat

 public static void assumeThat(object actual, Matcher matcher)
 {
   if (matcher.matches(actual))
     return;
   object obj = actual;
   Matcher matcher1 = matcher;
   Throwable.__\u003CsuppressFillInStackTrace\u003E();
   throw new AssumptionViolatedException(obj, matcher1);
 }
开发者ID:NALSS,项目名称:SmartDashboard.NET,代码行数:9,代码来源:Assume.cs

示例7: EmptyCollectionWhenNoFilesPresent

        public void EmptyCollectionWhenNoFilesPresent()
        {
            var matcher = new Matcher();
            var scenario = new FileSystemGlobbingTestContext(@"c:\files\", matcher)
                .Include("alpha.txt")
                .Execute();

            scenario.AssertExact();
        }
开发者ID:sujiantao,项目名称:FileSystem,代码行数:9,代码来源:PatternMatchingTests.cs

示例8: DuplicatePatterns

        public void DuplicatePatterns(string pattern1, string pattern2)
        {
            var matcher = new Matcher();
            matcher.AddInclude(pattern1);
            matcher.AddInclude(pattern2);

            ExecuteAndVerify(matcher, @"src/project",
                "src/project/sub/source2.cs");
        }
开发者ID:MetTeam,项目名称:FileSystem,代码行数:9,代码来源:FunctionalTests.cs

示例9: RegexWithGroupMatchTest

        public void RegexWithGroupMatchTest()
        {
            var match = new Matcher<string, string>
            {
                { Case.Rx(new Regex("this\\s(\\d{3})")), s => s }
            }.ToFunc();

            Assert.Equal("123", match("this 123"));
        }
开发者ID:danslapman,项目名称:PatternMatching,代码行数:9,代码来源:MatcherTests.cs

示例10: DoubleParentsWithRecursiveSearch

        public void DoubleParentsWithRecursiveSearch()
        {
            var matcher = new Matcher();
            matcher.AddInclude(@"..\..\lib\**\*.cs");

            ExecuteAndVerify(matcher, @"src/project",
                "lib/source6.cs",
                "lib/sub3/source7.cs",
                "lib/sub4/source8.cs");
        }
开发者ID:MetTeam,项目名称:FileSystem,代码行数:10,代码来源:FunctionalTests.cs

示例11: BuildableExpectation

		/// <summary>
		/// Initializes a new instance of the <see cref="BuildableExpectation"/> class.
		/// </summary>
		/// <param name="expectationDescription">The expectation description.</param>
		/// <param name="requiredCountMatcher">The required count matcher.</param>
		/// <param name="matchingCountMatcher">The matching count matcher.</param>
		public BuildableExpectation(string expectationDescription, Matcher requiredCountMatcher, Matcher matchingCountMatcher)
		{
			_expectationDescription = expectationDescription;
			_requiredCountMatcher = requiredCountMatcher;
			_matchingCountMatcher = matchingCountMatcher;

			ArgumentsMatcher = new ArgumentsMatcher();

			IsValid = false;
		}
开发者ID:textmetal,项目名称:main,代码行数:16,代码来源:BuildableExpectation.cs

示例12: SlashPolarityIsIgnored

        public void SlashPolarityIsIgnored(string includePattern, string filePath)
        {
            var matcher = new Matcher();
            var scenario = new FileSystemGlobbingTestContext(@"c:\files\", matcher)
                .Include(includePattern)
                .Files("one/two.txt", filePath, "three/four.txt")
                .Execute();

            scenario.AssertExact("beta/alpha.txt");
        }
开发者ID:leloulight,项目名称:FileSystem,代码行数:10,代码来源:PatternMatchingTests.cs

示例13: MismatchedFileIsIgnored

        public void MismatchedFileIsIgnored()
        {
            var matcher = new Matcher();
            var scenario = new FileSystemGlobbingTestContext(@"c:\files\", matcher)
                .Include("alpha.txt")
                .Files("omega.txt")
                .Execute();

            scenario.AssertExact();
        }
开发者ID:leloulight,项目名称:FileSystem,代码行数:10,代码来源:PatternMatchingTests.cs

示例14: PatternMatchingWorks

        public void PatternMatchingWorks(string includePattern, string[] matchesExpected)
        {
            var matcher = new Matcher();
            var scenario = new FileSystemGlobbingTestContext(@"c:\files\", matcher)
                .Include(includePattern)
                .Files("alpha.txt", "beta.txt", "gamma.dat")
                .Execute();

            scenario.AssertExact(matchesExpected);
        }
开发者ID:leloulight,项目名称:FileSystem,代码行数:10,代码来源:PatternMatchingTests.cs

示例15: FolderNamesAreTraversed

        public void FolderNamesAreTraversed()
        {
            var matcher = new Matcher();
            var scenario = new FileSystemGlobbingTestContext(@"c:\files\", matcher)
                .Include("beta/alpha.txt")
                .Files("beta/alpha.txt")
                .Execute();

            scenario.AssertExact("beta/alpha.txt");
        }
开发者ID:leloulight,项目名称:FileSystem,代码行数:10,代码来源:PatternMatchingTests.cs


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