-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
2.x: Add assertValueSetOnly and assertValueSequenceOnly to TestObserver + TestSubscriber #6010
2.x: Add assertValueSetOnly and assertValueSequenceOnly to TestObserver + TestSubscriber #6010
Conversation
* Assert that the TestObserver/TestSubscriber received only the specified values in any order without terminating. | ||
* @param values the values expected | ||
* @return this; | ||
* @since 2.1.14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please have these like this: 2.1.14 - experimental
|
||
try { | ||
to.assertValueSetOnly(Collections.singleton(5)); | ||
fail(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fail
throws AssertionError
so this test always passes. Perhaps throw a RuntimeException
or add a fail message and verify the catch
wasn't that message. Also this is overlooked in many other test using fail
and catch (AssertionError)
so it would be great if this could be fixed as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes would be great.
Codecov Report
@@ Coverage Diff @@
## 2.x #6010 +/- ##
============================================
- Coverage 98.28% 98.25% -0.04%
- Complexity 6074 6158 +84
============================================
Files 658 659 +1
Lines 44288 44522 +234
Branches 6145 6201 +56
============================================
+ Hits 43529 43743 +214
- Misses 228 233 +5
- Partials 531 546 +15
Continue to review full report at Codecov.
|
…er + TestSubscriber.
Addressed your feedback. |
* Assert that the TestObserver/TestSubscriber received only the specified values in any order without terminating. | ||
* @param expected the collection of values expected in any order | ||
* @return this; | ||
* @since 2.1.14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add - experimental
.
* Assert that the TestObserver/TestSubscriber received only the specified values in the specified order without terminating. | ||
* @param sequence the sequence of expected values in order | ||
* @return this; | ||
* @since 2.1.14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add - experimental
.
Whops. Forgot to commit that one, thanks. |
This basically copies the behavior of
assertValuesOnly
to theassertValueSet
andassertValueSequence
equivalent methods.Coped the tests exactly from
assertValuesOnly
and adjusted them with the new added methods.