Skip to content
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

Add first/last value assertions #3

Closed
peter-tackage opened this issue Jul 21, 2016 · 3 comments
Closed

Add first/last value assertions #3

peter-tackage opened this issue Jul 21, 2016 · 3 comments
Assignees

Comments

@peter-tackage
Copy link
Owner

To make it simpler to verify Observables which emit multiple values, there should be an assertion which can operate on the first and last emissions.

// For first values
assertThat(ts).hasReceivedFirstValue(value);
assertThat(ts).hasReceivedFirstValueWhich().hasLength(5);
assertThat(ts).hasReceivedFirstValuesWhich().isEmpty(); // List assertion

// Similarly, For last values
assertThat(ts).hasReceivedLastValue(value);
assertThat(ts).hasReceivedLastValueWhich().hasLength(5);
assertThat(ts).hasReceivedLastValuesWhich().isEmpty(); // List assertion
@peter-tackage
Copy link
Owner Author

peter-tackage commented Jul 27, 2016

assertThat(ts).hasReceivedFirstValue(value); done in 14bc627

assertThat(ts).hasReceivedLastValue(value) done in 3213161

assertThat(ts).hasReceivedFirstValueWhich() and assertThat(ts).hasReceivedLastValueWhich() done in 59385d8

@peter-tackage peter-tackage self-assigned this Jul 28, 2016
@peter-tackage
Copy link
Owner Author

Naming needs some thought for assertion of an individual List to avoid confusion with the other assertions which are asserting again all the emissions (as a List as received by TestSubscriber)

@peter-tackage
Copy link
Owner Author

Won't do the List implementation yet. I don't support it for single general elements currently.

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

No branches or pull requests

1 participant