I'm writing tests for a feature where people can e...
# android
s
I'm writing tests for a feature where people can either scan a code or type it in. Either way, the code goes to a backend for validation. I'm writing tests to validate that, for a given code, the screen does the expected thing. Should I write the same tests using both ways, or would just once be sufficient?
n
Test your backend that it works the way it should. How it gets the data doesn't matter, so the backend shouldn't really care if its typed in or scanned, it only needs the code. So test it with correct input, incorrect input and so on. But you should write a test for the scanning part if possible. To ensure that it works as intended.
s
This isn't involving the backend at all; I'm mocking it out.