1 min readNov 5, 2019
Don’t you think your example breaks some principles? As it defeats the purposes of injection, single responsibility… And worst of all, you can get your app to crash because of test code by accident :D
I have not seen the need and any Google reference about adding test code in the production code, to be fair.