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 MySessionsRepositoryTest #125

Merged
merged 2 commits into from Feb 6, 2017

Conversation

Projects
None yet
3 participants
@MoyuruAizawa
Contributor

MoyuruAizawa commented Feb 6, 2017

Overview (Required)

  • test MySessionsRepository
@@ -16,7 +16,7 @@
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
-public final class MySessionsLocalDataSource implements MySessionsDataSource {

This comment has been minimized.

@MoyuruAizawa

MoyuruAizawa Feb 6, 2017

Contributor

to mock

@MoyuruAizawa

MoyuruAizawa Feb 6, 2017

Contributor

to mock

+ fun save() {
+ val session = newDummySession(1)
+ localDataSource.save(session).invoked.thenReturn(Completable.complete())
+ with(TestObserver<Any>()) {

This comment has been minimized.

@MoyuruAizawa

MoyuruAizawa Feb 6, 2017

Contributor

to test Completable, Is this (<Any>) correct?

@MoyuruAizawa

MoyuruAizawa Feb 6, 2017

Contributor

to test Completable, Is this (<Any>) correct?

+ assertNoErrors()
+ assertResult(expected)
+ assertComplete()
+ }

This comment has been minimized.

@kgmyshin

kgmyshin Feb 6, 2017

Contributor

[imo]
I think rxjava2-test usually use test() method, as following.

repository.findAll().test().run {
  assertNoErrors()
  assertResult(expected)
  assertComplete()
}

other example: https://github.com/ReactiveX/RxJava/blob/d3455d0c9d57d522c31b5c25af83e8f2b8df12b6/src/test/java/io/reactivex/flowable/FlowableFuseableTest.java

@kgmyshin

kgmyshin Feb 6, 2017

Contributor

[imo]
I think rxjava2-test usually use test() method, as following.

repository.findAll().test().run {
  assertNoErrors()
  assertResult(expected)
  assertComplete()
}

other example: https://github.com/ReactiveX/RxJava/blob/d3455d0c9d57d522c31b5c25af83e8f2b8df12b6/src/test/java/io/reactivex/flowable/FlowableFuseableTest.java

This comment has been minimized.

@MoyuruAizawa

MoyuruAizawa Feb 6, 2017

Contributor

thanks!
i think it is better😀

@MoyuruAizawa

MoyuruAizawa Feb 6, 2017

Contributor

thanks!
i think it is better😀

This comment has been minimized.

@MoyuruAizawa

MoyuruAizawa Feb 6, 2017

Contributor

done.
this method is useful 🤣

@MoyuruAizawa

MoyuruAizawa Feb 6, 2017

Contributor

done.
this method is useful 🤣

This comment has been minimized.

@konifar

konifar Feb 6, 2017

Collaborator

@kgmyshin Thanks! Noted 📝

@konifar

konifar Feb 6, 2017

Collaborator

@kgmyshin Thanks! Noted 📝

@konifar

This comment has been minimized.

Show comment
Hide comment
@konifar

konifar Feb 6, 2017

Collaborator

LGTM! Thanks! 👍

Collaborator

konifar commented Feb 6, 2017

LGTM! Thanks! 👍

@konifar konifar merged commit 76d4975 into DroidKaigi:master Feb 6, 2017

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@MoyuruAizawa MoyuruAizawa deleted the MoyuruAizawa:add-MySessionsRepository-test branch Feb 7, 2017

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