After sketching out a full logic table for the in-order message verifier (KWHaveReceivedInOrderMatcher), I've discovered some reasonable cases that aren't handled and I think it would be worthwhile creating a full set of four matchers: beforeFirst, beforeLast, afterFirst, and afterLast. With these, and the use of "shouldNot" to perform exclusive tests, I think all the cases can be covered, and fairly cleanly at that.
I also think it would be easier to understand and reason about the unit tests for this matcher if the test conditions were simple "ab", "aba", "babba", etc., patterns, as opposed to the more descriptive versions there now. This should also allow the test parameters to be expressed more concisely, while making it easy to exhaustively test every case.
After sketching out a full logic table for the in-order message verifier (KWHaveReceivedInOrderMatcher), I've discovered some reasonable cases that aren't handled and I think it would be worthwhile creating a full set of four matchers: beforeFirst, beforeLast, afterFirst, and afterLast. With these, and the use of "shouldNot" to perform exclusive tests, I think all the cases can be covered, and fairly cleanly at that.
I also think it would be easier to understand and reason about the unit tests for this matcher if the test conditions were simple "ab", "aba", "babba", etc., patterns, as opposed to the more descriptive versions there now. This should also allow the test parameters to be expressed more concisely, while making it easy to exhaustively test every case.