Skip to content

Commit

Permalink
Update gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongpm committed Feb 17, 2019
1 parent 49cab7a commit 655f01c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ task jacocoTestReport(type: JacocoReport, dependsOn: 'testDebugUnitTest') {
'**/*Component*.*', '**/*Module*.*',

'**/component/widget/*.*', '**/component/binding/*.*', '**/util/ext/*.*',
'**/util/scheduler/*.*', '**/DLApplication.*']
'**/util/scheduler/*.*', '**/util/fragment/*.*', '**/DLApplication.*',
'**/ViewModelFactory.*', '**/RoomConverter.*', '**/AppDatabase.*']

def javaClasses = fileTree(dir: "$project.buildDir/intermediates/javac/debug", excludes: fileFilter)
def kotlinClasses = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug", excludes: fileFilter)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.youtubedl.ui.main.progress

import android.arch.core.executor.testing.InstantTaskExecutorRule
import android.arch.lifecycle.ViewModelProvider
import android.databinding.ObservableArrayList
import android.support.test.espresso.Espresso.onView
Expand Down Expand Up @@ -49,6 +50,9 @@ class ProgressFragmentTest {

private val screen = Screen()

@get:Rule
val instantExecutorRule = InstantTaskExecutorRule()

@get:Rule
val uiRule = InjectedFragmentTestRule<ProgressFragment> {
it.mainActivity = mainActivity
Expand Down Expand Up @@ -88,6 +92,16 @@ class ProgressFragmentTest {
screen.hasEmptyLayout(false)
}

@Test
fun observe_download_video_event() {
progressInfos.addAll(listOf(progressInfo1, progressInfo2))
doReturn(progressInfos).`when`(progressViewModel).progressInfos
val videoInfo = VideoInfo(id = "id", downloadUrl = "url")
screen.start()
downloadVideoEvent.value = videoInfo
verify(progressViewModel).downloadVideo(videoInfo)
}

inner class Screen {
fun start() {
progressFragment = ProgressFragment()
Expand Down

0 comments on commit 655f01c

Please sign in to comment.