-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
5 deletions.
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
15 changes: 15 additions & 0 deletions
15
app/src/test/java/com/youtubedl/ui/main/home/MainViewModelTest.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 |
---|---|---|
@@ -1,9 +1,24 @@ | ||
package com.youtubedl.ui.main.home | ||
|
||
import org.junit.Before | ||
import org.junit.Test | ||
|
||
/** | ||
* Created by cuongpm on 1/14/19. | ||
*/ | ||
|
||
class MainViewModelTest { | ||
|
||
private lateinit var mainViewModel: MainViewModel | ||
|
||
@Before | ||
fun setup() { | ||
mainViewModel = MainViewModel() | ||
} | ||
|
||
@Test | ||
fun `test MainViewModel here`() { | ||
mainViewModel.start() | ||
mainViewModel.stop() | ||
} | ||
} |
25 changes: 23 additions & 2 deletions
25
app/src/test/java/com/youtubedl/ui/main/player/VideoPlayerViewModelTest.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 |
---|---|---|
@@ -1,8 +1,29 @@ | ||
package com.youtubedl.ui.main.player | ||
|
||
import org.junit.Assert.* | ||
import org.junit.Assert.assertEquals | ||
import org.junit.Before | ||
import org.junit.Test | ||
|
||
/** | ||
* Created by cuongpm on 1/29/19. | ||
*/ | ||
class VideoPlayerViewModelTest | ||
class VideoPlayerViewModelTest { | ||
|
||
private lateinit var videoPlayerViewModel: VideoPlayerViewModel | ||
|
||
@Before | ||
fun setup() { | ||
videoPlayerViewModel = VideoPlayerViewModel() | ||
} | ||
|
||
@Test | ||
fun `test video volume on`() { | ||
assertEquals(1.0f, videoPlayerViewModel.getVolume()) | ||
} | ||
|
||
@Test | ||
fun `test video volume off`() { | ||
videoPlayerViewModel.isVolumeOn = false | ||
assertEquals(0.0f, videoPlayerViewModel.getVolume()) | ||
} | ||
} |