Merge pull request #6706 from litetex/fix-format-of-some-kotlin-files
Fix format of some kotlin files
This commit is contained in:
commit
cebcaf4d6a
|
@ -27,11 +27,11 @@ class LocalPlaylistManagerTest {
|
||||||
@Before
|
@Before
|
||||||
fun setup() {
|
fun setup() {
|
||||||
database = Room.inMemoryDatabaseBuilder(
|
database = Room.inMemoryDatabaseBuilder(
|
||||||
ApplicationProvider.getApplicationContext(),
|
ApplicationProvider.getApplicationContext(),
|
||||||
AppDatabase::class.java
|
AppDatabase::class.java
|
||||||
)
|
)
|
||||||
.allowMainThreadQueries()
|
.allowMainThreadQueries()
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
manager = LocalPlaylistManager(database)
|
manager = LocalPlaylistManager(database)
|
||||||
}
|
}
|
||||||
|
@ -44,8 +44,8 @@ class LocalPlaylistManagerTest {
|
||||||
@Test
|
@Test
|
||||||
fun createPlaylist() {
|
fun createPlaylist() {
|
||||||
val stream = StreamEntity(
|
val stream = StreamEntity(
|
||||||
serviceId = 1, url = "https://newpipe.net/", title = "title",
|
serviceId = 1, url = "https://newpipe.net/", title = "title",
|
||||||
streamType = StreamType.VIDEO_STREAM, duration = 1, uploader = "uploader"
|
streamType = StreamType.VIDEO_STREAM, duration = 1, uploader = "uploader"
|
||||||
)
|
)
|
||||||
|
|
||||||
val result = manager.createPlaylist("name", listOf(stream))
|
val result = manager.createPlaylist("name", listOf(stream))
|
||||||
|
@ -68,13 +68,13 @@ class LocalPlaylistManagerTest {
|
||||||
@Test()
|
@Test()
|
||||||
fun createPlaylist_nonExistentStreamsAreUpserted() {
|
fun createPlaylist_nonExistentStreamsAreUpserted() {
|
||||||
val stream = StreamEntity(
|
val stream = StreamEntity(
|
||||||
serviceId = 1, url = "https://newpipe.net/", title = "title",
|
serviceId = 1, url = "https://newpipe.net/", title = "title",
|
||||||
streamType = StreamType.VIDEO_STREAM, duration = 1, uploader = "uploader"
|
streamType = StreamType.VIDEO_STREAM, duration = 1, uploader = "uploader"
|
||||||
)
|
)
|
||||||
database.streamDAO().insert(stream)
|
database.streamDAO().insert(stream)
|
||||||
val upserted = StreamEntity(
|
val upserted = StreamEntity(
|
||||||
serviceId = 1, url = "https://newpipe.net/2", title = "title2",
|
serviceId = 1, url = "https://newpipe.net/2", title = "title2",
|
||||||
streamType = StreamType.VIDEO_STREAM, duration = 1, uploader = "uploader"
|
streamType = StreamType.VIDEO_STREAM, duration = 1, uploader = "uploader"
|
||||||
)
|
)
|
||||||
|
|
||||||
val result = manager.createPlaylist("name", listOf(stream, upserted))
|
val result = manager.createPlaylist("name", listOf(stream, upserted))
|
||||||
|
|
|
@ -18,20 +18,20 @@ class TrampolineSchedulerRule : TestRule {
|
||||||
private val scheduler = Schedulers.trampoline()
|
private val scheduler = Schedulers.trampoline()
|
||||||
|
|
||||||
override fun apply(base: Statement, description: Description): Statement =
|
override fun apply(base: Statement, description: Description): Statement =
|
||||||
object : Statement() {
|
object : Statement() {
|
||||||
override fun evaluate() {
|
override fun evaluate() {
|
||||||
try {
|
try {
|
||||||
RxJavaPlugins.setComputationSchedulerHandler { scheduler }
|
RxJavaPlugins.setComputationSchedulerHandler { scheduler }
|
||||||
RxJavaPlugins.setIoSchedulerHandler { scheduler }
|
RxJavaPlugins.setIoSchedulerHandler { scheduler }
|
||||||
RxJavaPlugins.setNewThreadSchedulerHandler { scheduler }
|
RxJavaPlugins.setNewThreadSchedulerHandler { scheduler }
|
||||||
RxJavaPlugins.setSingleSchedulerHandler { scheduler }
|
RxJavaPlugins.setSingleSchedulerHandler { scheduler }
|
||||||
RxAndroidPlugins.setInitMainThreadSchedulerHandler { scheduler }
|
RxAndroidPlugins.setInitMainThreadSchedulerHandler { scheduler }
|
||||||
|
|
||||||
base.evaluate()
|
base.evaluate()
|
||||||
} finally {
|
} finally {
|
||||||
RxJavaPlugins.reset()
|
RxJavaPlugins.reset()
|
||||||
RxAndroidPlugins.reset()
|
RxAndroidPlugins.reset()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue