public void TestAnyMatcher() { var m = Matcher.Any(Matcher.Char('a'), Matcher.String("bc")); Assert.Equal(1, m.Match(new MatchContent("abc", 0, MatchDirection.Forward))); Assert.Equal(Matcher.NotMatch, m.Match(new MatchContent("abc", 0, MatchDirection.Backward))); Assert.Equal(2, m.Match(new MatchContent("abc", 1, MatchDirection.Forward))); Assert.Equal(1, m.Match(new MatchContent("abc", 1, MatchDirection.Backward))); Assert.Equal(Matcher.NotMatch, m.Match(new MatchContent("abc", 2, MatchDirection.Forward))); Assert.Equal(Matcher.NotMatch, m.Match(new MatchContent("abc", 2, MatchDirection.Backward))); Assert.Equal(Matcher.NotMatch, m.Match(new MatchContent("abc", 3, MatchDirection.Forward))); Assert.Equal(2, m.Match(new MatchContent("abc", 3, MatchDirection.Backward))); Assert.Equal(Matcher.NotMatch, m.Match(new MatchContent("cba", 3, MatchDirection.Forward))); Assert.Equal(1, m.Match(new MatchContent("cba", 3, MatchDirection.Backward))); Assert.Equal(1, m.Match(new MatchContent("cba", 2, MatchDirection.Forward))); Assert.Equal(Matcher.NotMatch, m.Match(new MatchContent("cba", 2, MatchDirection.Backward))); }
public static IAnyOfMatcher AnyOf <T1, T2, T3, T4, T5, T6>() where T1 : IComponent where T2 : IComponent where T3 : IComponent where T4 : IComponent where T5 : IComponent where T6 : IComponent { return(Matcher <C, T1, T2, T3, T4, T5, T6> .Any()); }
public static IAnyOfMatcher AnyOf <T1, T2, T3>() where T1 : IComponent where T2 : IComponent where T3 : IComponent { return(Matcher <C, T1, T2, T3> .Any()); }
public static IAnyOfMatcher AnyOf <T1>() where T1 : IComponent { return(Matcher <C, T1> .Any()); }
public static IGroup AnyOf<T1, T2, T3, T4, T5, T6>() where T1 : IComponent where T2 : IComponent where T3 : IComponent where T4 : IComponent where T5 : IComponent where T6 : IComponent { return Instance.GetGroup(Matcher<C, T1, T2, T3, T4, T5, T6>.Any()); }
public static IGroup AnyOf<T1, T2>() where T1 : IComponent where T2 : IComponent { return Instance.GetGroup(Matcher<C, T1, T2>.Any()); }