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 TestSubscriber #170

Merged
merged 2 commits into from
Jun 8, 2015
Merged

Add TestSubscriber #170

merged 2 commits into from
Jun 8, 2015

Conversation

zsxwing
Copy link
Member

@zsxwing zsxwing commented Jun 6, 2015

This PR adds TestSubscriber to RxScala.

There are two differences between RxJava TestSubscriber and RxScala TestSubscriber.

  • RxScala uses a singleton Notification.OnCompleted, so instead of adding getOnCompletedEvents to RxScala, I add getOnCompletedEventsCount that just return the number of Notification.OnCompleteds.
  • RxJava has two similar methods: assertReceivedOnNext(List<T> items) and assertValues(T... values). Since they are almost same exception the parameter type, I only add assertValues(T... values) to RxScala.

Question:

  • Do we need to add TestObserver? Is there a case that TestObserver is more useful than TestSubscriber?
  • Better name for getOnCompletedEventsCount?

@zsxwing
Copy link
Member Author

zsxwing commented Jun 8, 2015

cc @samuelgruetter

@samuelgruetter
Copy link
Collaborator

  • Do we need to add TestObserver? Is there a case that TestObserver is more useful than TestSubscriber?

I can't think of any such case. Let's not add it until some users request it.

  • Better name for getOnCompletedEventsCount?

I would not add this method, nor getOnCompletedEvents. Instead, one should use assertCompleted and assertNotCompleted.

The user should use assertCompleted or assertNotCompleted
@zsxwing
Copy link
Member Author

zsxwing commented Jun 8, 2015

I would not add this method, nor getOnCompletedEvents. Instead, one should use assertCompleted and assertNotCompleted.

Agree. Removed it.

@samuelgruetter
Copy link
Collaborator

LGTM

zsxwing added a commit that referenced this pull request Jun 8, 2015
@zsxwing zsxwing merged commit 271fa51 into ReactiveX:0.x Jun 8, 2015
@zsxwing zsxwing deleted the TestSubscriber branch June 8, 2015 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants