2.x: Add assertValueSetOnly and assertValueSequenceOnly to TestObserver + TestSubscriber#6010
2.x: Add assertValueSetOnly and assertValueSequenceOnly to TestObserver + TestSubscriber#6010akarnokd merged 3 commits into
Conversation
There was a problem hiding this comment.
Please have these like this: 2.1.14 - experimental
|
|
||
| try { | ||
| to.assertValueSetOnly(Collections.singleton(5)); | ||
| fail(); |
There was a problem hiding this comment.
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.
akarnokd
left a comment
There was a problem hiding this comment.
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 |
| * 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 |

This basically copies the behavior of
assertValuesOnlyto theassertValueSetandassertValueSequenceequivalent methods.Coped the tests exactly from
assertValuesOnlyand adjusted them with the new added methods.