New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
more assertions on collection sizes #301
Comments
I like that feature but |
Sorry I didn't grok how adding a size() method would not be consistent with ByteAssert (which is a byte, not a collection with a size value); is it the name "size" you're objecting to? Got a better idea for the name of the function? |
how about assertSize()? as in:
to make it clear its different from the size() method on a List but related to it? |
or hasSize()? |
there is already an I must say I don't see much value in the proposal over what you can already write: assertThat(someList.size()).isGreaterThan(4); Do you have others use case in mind ? |
How do you get the java.util.List from a ListAssert so that you can call .size() on it so that you can use it on an assertThat() call? If there was a way to get the List value out of ListAssert, then thats an OK approach - but its not very smart-complete-in-your-IDE friendly. I just figured, in the interest of IDE completion; having a way to navigate from ListAssert to an IntegerAssert for the size of a List seems to make the cleanest IDE-friendly DSL. e.g. here's an example.... through the DSL I can find a List of pods which are a ListAssert - however there's no way I can find to make an assertion on the size of that list - other than by doing a totally separate query to find the real List thats inside the ListAssert; which just seems odd. Unless I'm missing something? |
Ok why not. |
tried change to "enable fluent assertions on size of iterable"
tried change to "enable fluent assertions on size of iterable"
Fixed. |
I figured on a ListAssert I'd be able to do things like...
i.e. that a method size() would be available returning the IntegerAssert for further more expressive assertions on a List size.
I can submit a PR if you like?
The text was updated successfully, but these errors were encountered: