-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'frontend' into database-design
- Loading branch information
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,11 @@ jobs: | |
run: chmod +x ./gradlew | ||
|
||
- name: Execute Gradle command - unitTest | ||
run: ./gradlew testDebugUnitTest | ||
run: ./gradlew testDebugUnitTest --continue | ||
|
||
- name: Upload Test Reports | ||
if: ${{ always() }} | ||
uses: actions/[email protected] | ||
with: | ||
name: test-reports | ||
path: '**/build/reports/tests/' |
28 changes: 28 additions & 0 deletions
28
app/src/test/java/com/example/harmonyhub/defaulthomescreen/DefaultHomeScreenTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import com.example.harmonyhub.data.network.* | ||
import com.example.harmonyhub.data.network.Response | ||
import com.example.harmonyhub.data.repository.DefaultHomeScreenRepo | ||
import kotlinx.coroutines.runBlocking | ||
import okhttp3.* | ||
import org.junit.Assert.* | ||
import org.junit.Before | ||
import org.junit.Test | ||
import java.io.IOException | ||
|
||
class DefaultHomeScreenRepoTest { | ||
|
||
private lateinit var repo: DefaultHomeScreenRepo | ||
|
||
@Before | ||
fun setUp() { | ||
repo = DefaultHomeScreenRepo() | ||
} | ||
|
||
@Test | ||
fun `test updatePopularItem success`() = runBlocking { | ||
var result = repo.updatePopularItem() | ||
assertNotNull(result) | ||
assertEquals(result!!.listPopularAlbums!!.size, 9) | ||
assertEquals(result!!.listPopularArtist!!.size, 10) | ||
assertEquals(result!!.listChart!!.size, 6) | ||
} | ||
} |