77package org.readium.r2.shared.publication.services
88
99import kotlinx.coroutines.ExperimentalCoroutinesApi
10- import kotlinx.coroutines.test.runBlockingTest
10+ import kotlinx.coroutines.test.runTest
1111import org.junit.Test
1212import org.readium.r2.shared.publication.Link
1313import org.readium.r2.shared.publication.Locator
@@ -19,7 +19,7 @@ class LocatorServiceTest {
1919
2020 // locate(Locator) checks that the href exists.
2121 @Test
22- fun `locate from Locator` () = runBlockingTest {
22+ fun `locate from Locator` () = runTest {
2323 val service = createService(readingOrder = listOf (
2424 Link (href = " chap1" , type = " application/xml" ),
2525 Link (href = " chap2" , type = " application/xml" ),
@@ -30,14 +30,14 @@ class LocatorServiceTest {
3030 }
3131
3232 @Test
33- fun `locate from Locator with empty reading order` () = runBlockingTest {
33+ fun `locate from Locator with empty reading order` () = runTest {
3434 val service = createService(readingOrder = emptyList())
3535 val locator = Locator (href = " chap2" , type = " text/html" , text = Locator .Text (highlight = " Highlight" ))
3636 assertNull(service.locate(locator))
3737 }
3838
3939 @Test
40- fun `locate from Locator not found` () = runBlockingTest {
40+ fun `locate from Locator not found` () = runTest {
4141 val service = createService(readingOrder = listOf (
4242 Link (href = " chap1" , type = " application/xml" ),
4343 Link (href = " chap3" , type = " application/xml" )
@@ -47,7 +47,7 @@ class LocatorServiceTest {
4747 }
4848
4949 @Test
50- fun `locate from progression` () = runBlockingTest {
50+ fun `locate from progression` () = runTest {
5151 val service = createService(positions = positionsFixtures)
5252
5353 assertEquals(Locator (
@@ -116,14 +116,14 @@ class LocatorServiceTest {
116116 }
117117
118118 @Test
119- fun `locate from incorrect progression` () = runBlockingTest {
119+ fun `locate from incorrect progression` () = runTest {
120120 val service = createService(positions = positionsFixtures)
121121 assertNull(service.locateProgression(- 0.2 ))
122122 assertNull(service.locateProgression(1.2 ))
123123 }
124124
125125 @Test
126- fun `locate from progression with empty positions` () = runBlockingTest {
126+ fun `locate from progression with empty positions` () = runTest {
127127 val service = createService(positions = emptyList())
128128 assertNull(service.locateProgression(0.5 ))
129129 }
0 commit comments