Skip to content

Comments

Adding IsTraversedAs matcher#128

Closed
erosb wants to merge 3 commits intohamcrest:masterfrom
erosb:master
Closed

Adding IsTraversedAs matcher#128
erosb wants to merge 3 commits intohamcrest:masterfrom
erosb:master

Conversation

@erosb
Copy link

@erosb erosb commented Dec 4, 2015

Hello,

this IsTraversedAs matcher implementation checks that if an expected and an actual Iterable

  • return the same number of elements
  • return equal elements

I would firstly find it useful, for example when my SUT returns an ArrayList instance and I create my expected list using an Arrays.asList() call (that is something I find myself doing quite often).

An other usecase can be developing a self-written Iterable implementation (the developer may find the IsTraversedAs matcher useful for asserting).

Please review it. Thanks.

@sf105
Copy link
Member

sf105 commented Apr 6, 2016

how does this differ from IsIterableContainingInOrder.contains() ?

@erosb
Copy link
Author

erosb commented Apr 6, 2016

Yes, that seems to be the same (although its name is not good at all).

@erosb erosb closed this Apr 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants