File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed
app/src/test/java/com/example/harmonyhub/defaulthomescreen Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 23
23
run : chmod +x ./gradlew
24
24
25
25
- name : Execute Gradle command - unitTest
26
- run : ./gradlew testDebugUnitTest
26
+ run : ./gradlew testDebugUnitTest --continue
27
+
28
+ - name : Upload Test Reports
29
+ if : ${{ always() }}
30
+
31
+ with :
32
+ name : test-reports
33
+ path : ' **/build/reports/tests/'
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments