Missing methods to check min and max List size #130

Open
renegrob opened this Issue Dec 10, 2012 · 1 comment

Comments

Projects
None yet
2 participants
@renegrob

It would be nice to be able to write something like:
assertThat(myList).size().isGreaterThan(3);

Is it feasible that size() returns a SizeAssertion while isGreater returns again the original ListAssertion?

@joel-costigliola

This comment has been minimized.

Show comment
Hide comment
@joel-costigliola

joel-costigliola Dec 12, 2012

Contributor

You can do this, it's almost what you are asking :

assertThat(myList.size()).isGreaterThan(3);

BTW, I don't think it's a good idea to switch between assertions type (in your example SizeAssertion then ListAssertion) because it's confusing when you read the code.

If it's ok for you, please close this issue.

Regards,

Contributor

joel-costigliola commented Dec 12, 2012

You can do this, it's almost what you are asking :

assertThat(myList.size()).isGreaterThan(3);

BTW, I don't think it's a good idea to switch between assertions type (in your example SizeAssertion then ListAssertion) because it's confusing when you read the code.

If it's ok for you, please close this issue.

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment