currently trying to test the interactions with ViewBinding classes in Unit Tests
"Invalid Input" should {
"disable the LoginButton" {
val viewBinding: FrLoginBinding = mockk()
InvalidInputViewStateBinder.bind(InvalidInput, viewBinding)
verify { viewBinding.loginButton.isEnabled = false }
}
}
something like this is what i had in mind. The Views in the ViewBinding are public final Properties and cannot easily be mocked. At least i'm unable to. Passing a View
mock to create the ViewBinding also doesn't work, as i'd have to mock findViewById
for it.
Has anyone tried this out and got it to work?