Skip to content

Commit

Permalink
Add @SInCE tags to TestObserver features
Browse files Browse the repository at this point in the history
  • Loading branch information
sczerwinski committed Jan 14, 2021
1 parent ee1bec3 commit 065eab3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lifecycle/livedata-test-common/src/main/java/Test.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import androidx.lifecycle.Observer

/**
* Creates a non-forwarding [TestObserver] observing all values emitted by this [LiveData].
*
* @since 1.1.0
*/
fun <T> LiveData<T>.test(): TestObserver<T> {
val observer = TestObserver.create<T>()
Expand All @@ -31,6 +33,8 @@ fun <T> LiveData<T>.test(): TestObserver<T> {

/**
* Creates a forwarding [TestObserver] observing all values emitted by this [LiveData].
*
* @since 1.1.0
*/
fun <T> LiveData<T>.test(downstream: Observer<T>): TestObserver<T> {
val observer = TestObserver.create(downstream)
Expand Down
2 changes: 2 additions & 0 deletions lifecycle/livedata-test-common/src/main/java/TestObserver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import androidx.lifecycle.Observer

/**
* A callback testing values emitted by [LiveData].
*
* @since 1.1.0
*/
@Suppress("TooManyFunctions")
class TestObserver<T> internal constructor(
Expand Down

0 comments on commit 065eab3

Please sign in to comment.