You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, Concatenates only works if given parsers are in the same page or have positive page numbers.
Instead of using a property for PageNumber, create a method to pass the current page and the relative page Parsinator is currently trying to parse. Maybe introduce a method in the base class?
[Test]publicvoidParse_ConcatenateTwoPagedParsersANegativeAndPositivePageNumber_ParsersValueFromBothParsersInGivenPages(){varp=newDictionary<String,IList<IParse>>{{"Key",newList<IParse>{newConcatenate(key:"Value",separator:"|",newList<IParse>{newParseFromRegex(key:"Result",pageNumber:-1,pattern:newRegex(@"Result:\s*(\w+)")),newParseFromRegex(key:"Value",pageNumber:2,pattern:newRegex(@"Value:\s*(\d+)"))})}}};varlines=FromPagesText(@"Page1 This is a dummy page Page-3",@"Page2 Value: 123456 Page-2",@"Page3 Result: Foo Page-1");varparser=newParser(p);vards=parser.Parse(lines);Assert.AreEqual("Foo|123456",ds["Key"]["Value"]);}
The text was updated successfully, but these errors were encountered:
Now, Concatenates only works if given parsers are in the same page or have positive page numbers.
Instead of using a property for
PageNumber
, create a method to pass the current page and the relative page Parsinator is currently trying to parse. Maybe introduce a method in the base class?The text was updated successfully, but these errors were encountered: