public void IsMatchedSampleIsCorrect(Mask.Mask mask, string group, string estimatedMatch) { Regex regex = new Regex(mask.RegexString); var result = regex.Match(mask.SampleInput); var currentMatchValue = result.Groups[group].Value; Assert.AreEqual(estimatedMatch, currentMatchValue); }
public Dictionary <string, string> MatchTestByIndexer(Mask.Mask mask, string TextToParse) { var afterParse = (SuccededResult)mask.Parse("", TextToParse); foreach (KeyValuePair <string, string> keyValuePair in afterParse.MatchedResult) { Assert.AreEqual(keyValuePair.Value, afterParse[keyValuePair.Key]); } return(afterParse.MatchedResult); }
public void IsSampleInputMatchingWithRegex(Mask.Mask mask) { Regex regex = new Regex(mask.RegexString); var result = regex.Match(mask.SampleInput); foreach (Group @group in result.Groups) { Console.WriteLine(@group.Value); } Assert.True(result.Success); }
public void Setup() { this.actions = new Actions(); this.mask = Builder.Bot().Requried("Test").End(); }
public Dictionary <string, string> MatchTest(Mask.Mask mask, string TextToParse) { var result = (SuccededResult)mask.Parse("", TextToParse); return(result.MatchedResult); }