# android


02/28/2020, 6:33 PM
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?

Nikola Milovic

02/29/2020, 12:57 PM
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.


03/02/2020, 9:19 PM
This isn't involving the backend at all; I'm mocking it out.