public void NoMatch() { var matcher = new XPathMatcher("//nhn:ssn = '13116900217'"); matcher.AddNamespace("nhn", "http://register.nhn.no/Orchestration"); Assert.False(matcher.Matches(null, new Microsoft.AspNetCore.Http.QueryString(), BODY, null)); }
public void XPathToStringWithHttpMethods() { var matcher = new XPathMatcher("/x/path/"); matcher.SetMatchingHttpMethods("get post"); Assert.Equal("XPath '/x/path/' (GET,POST)", matcher.ToString()); }
public void XPathMatcher_GetName() { // Assign var matcher = new XPathMatcher("X"); // Act string name = matcher.GetName(); // Assert Check.That(name).Equals("XPathMatcher"); }
public void XPathMatcher_GetPatterns() { // Assign var matcher = new XPathMatcher("X"); // Act string[] patterns = matcher.GetPatterns(); // Assert Check.That(patterns).ContainsExactly("X"); }
public void XPathMatcher_IsMatch_RejectOnMatch() { // Assign string xml = @" <todo-list> <todo-item id='a1'>abc</todo-item> </todo-list>"; var matcher = new XPathMatcher(MatchBehaviour.RejectOnMatch, false, "/todo-list[count(todo-item) = 1]"); // Act double result = matcher.IsMatch(xml); // Assert Check.That(result).IsEqualTo(0.0); }
public void XPathMatcher_IsMatch_AcceptOnMatch() { // Assign string xml = @" <todo-list> <todo-item id='a1'>abc</todo-item> </todo-list>"; var matcher = new XPathMatcher("/todo-list[count(todo-item) = 1]"); // Act double result = matcher.IsMatch(xml); // Assert Check.That(result).IsEqualTo(1.0); }
public void XPathToStringWithoutHttpMethods() { var matcher = new XPathMatcher("/x/path/"); Assert.Equal("XPath '/x/path/'", matcher.ToString()); }