Last active
August 26, 2018 15:26
-
-
Save SeongUgJung/8b23c8586e3c18c8646870d0e7bf4b72 to your computer and use it in GitHub Desktop.
test resourceProvider
This file contains hidden or 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
class MainViewModelTest { | |
private lateinit var vm : MainViewModel | |
private lateinit var resourcesProvider : ResourcesProvider | |
@Setup | |
fun init() { | |
resourcesProvider = mock(ResourcesProvider::class) | |
vm = MainViewModelImpl(resourcesProvider) | |
} | |
@Test | |
fun click() { | |
when(resourcesProvider.getString(R.string.name_title)).thenReturn("name") | |
vm.click() | |
assertThat(vm.name.get()).equals("name") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment