-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from btrautmann/develop
Fix publishing issues by adding aar as an artifact.
- Loading branch information
Showing
11 changed files
with
81 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
rxfirestore/src/test/java/com/oakwoodsc/rxfirestore/ExampleUnitTest.java
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
rxfirestore/src/test/java/com/oakwoodsc/rxfirestore/RxFirestoreDbTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.oakwoodsc.rxfirestore | ||
|
||
import com.google.firebase.firestore.DocumentReference | ||
import com.google.firebase.firestore.DocumentSnapshot | ||
import com.google.firebase.firestore.EventListener | ||
import com.nhaarman.mockito_kotlin.argumentCaptor | ||
import com.nhaarman.mockito_kotlin.mock | ||
import com.nhaarman.mockito_kotlin.times | ||
import com.nhaarman.mockito_kotlin.verify | ||
import io.reactivex.subscribers.TestSubscriber | ||
import org.junit.Assert.assertEquals | ||
import org.junit.Before | ||
import org.junit.Test | ||
import org.mockito.MockitoAnnotations | ||
|
||
class RxFirestoreDbTests { | ||
|
||
private val documentSnapshotListener = argumentCaptor<EventListener<DocumentSnapshot>>() | ||
|
||
@Before | ||
|
||
fun setUp() { | ||
MockitoAnnotations.initMocks(this) | ||
} | ||
|
||
@Test | ||
fun sanityTest() { | ||
assertEquals(4, (2 + 2).toLong()) | ||
} | ||
|
||
@Test | ||
fun testDocumentSnapshots() { | ||
val docReference = mock<DocumentReference>() | ||
val snapshot = mock<DocumentSnapshot>() | ||
|
||
with(TestSubscriber.create<DocumentSnapshot>()) { | ||
RxFirestoreDb.documentSnapshots(docReference).subscribe() | ||
|
||
docReference.verifySnapshotListenerAdded() | ||
|
||
} | ||
|
||
} | ||
|
||
private fun DocumentReference.verifySnapshotListenerAdded() { | ||
verify(this, times(1)) | ||
.addSnapshotListener(documentSnapshotListener.capture()) | ||
} | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
rxfirestorekt/src/test/java/com/oakwoodsc/rxfirestorekt/ExampleUnitTest.java
This file was deleted.
Oops, something went wrong.