public void RegexException() { Assert.Throws <ArgumentException>(() => { var selector = new RegexSelector("\\d+("); selector.Select(""); }); }
public void TestRegexWithLeftBracketQuoted() { string regex = "\\(.+"; string source = "(hello world"; RegexSelector regexSelector = new RegexSelector(regex); string select = regexSelector.Select(source); Assert.Equal(select, source); }
public void RegexException() { try { var selector = new RegexSelector("\\d+("); selector.Select(""); throw new Exception("Test case failed"); } catch (Exception e) { Assert.Equal("Invalid pattern '\\d+(' at offset 4. Not enough )'s.", e.Message); } }
public void SelectOnInvalidElementResourceWorks() { var actual = validSelector.Select(invalidResource).Select(r => r.AsString()); Assert.Empty(actual); }
public void SelectByNotMatchingSelectorReturnsEmptySequence() { var actual = notMatchingSelector.Select(stringResource).Select(r => r.AsString()); Assert.Empty(actual); }