public void Should_Return_Empty_String() { IMatch match = new SuccessMatch(""); Assert.True(match.Success()); Assert.Equal("", match.RemainingText()); }
public void CheckWord_Numbers() { var range = new Range('1', '9'); IMatch match = new SuccessMatch("5"); Assert.True(match.Success()); Assert.Equal("5", match.RemainingText()); }
public IMatch Match(string text) { IMatch match = new SuccessMatch(text); while (match.Success()) { match = pattern.Match(match.RemainingText()); } return(new SuccessMatch(match.RemainingText())); }
public IMatch Match(string text) { IMatch match = new SuccessMatch(text); foreach (var pattern in patterns) { match = pattern.Match(match.RemainingText()); if (!match.Success()) { return(new FailedMatch(text)); } } return(match); }
public void Check__Word_HasHexadecimal_Characters_(string input) { var hex = new SuccessMatch(input); Assert.True(hex.Success()); }