Skip to content

Commit 1364d52

Browse files
committed
Merge branch 'frontend' into database-design
2 parents 8943784 + fd54f20 commit 1364d52

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

.github/workflows/test_debug.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,11 @@ jobs:
2323
run: chmod +x ./gradlew
2424

2525
- name: Execute Gradle command - unitTest
26-
run: ./gradlew testDebugUnitTest
26+
run: ./gradlew testDebugUnitTest --continue
27+
28+
- name: Upload Test Reports
29+
if: ${{ always() }}
30+
uses: actions/[email protected]
31+
with:
32+
name: test-reports
33+
path: '**/build/reports/tests/'
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import com.example.harmonyhub.data.network.*
2+
import com.example.harmonyhub.data.network.Response
3+
import com.example.harmonyhub.data.repository.DefaultHomeScreenRepo
4+
import kotlinx.coroutines.runBlocking
5+
import okhttp3.*
6+
import org.junit.Assert.*
7+
import org.junit.Before
8+
import org.junit.Test
9+
import java.io.IOException
10+
11+
class DefaultHomeScreenRepoTest {
12+
13+
private lateinit var repo: DefaultHomeScreenRepo
14+
15+
@Before
16+
fun setUp() {
17+
repo = DefaultHomeScreenRepo()
18+
}
19+
20+
@Test
21+
fun `test updatePopularItem success`() = runBlocking {
22+
var result = repo.updatePopularItem()
23+
assertNotNull(result)
24+
assertEquals(result!!.listPopularAlbums!!.size, 9)
25+
assertEquals(result!!.listPopularArtist!!.size, 10)
26+
assertEquals(result!!.listChart!!.size, 6)
27+
}
28+
}

0 commit comments

Comments
 (0)