It is not entirely clear whether it is necessary to completely cover everything with tests, even those methods that can not break precisely because of their simplicity, or still only logical sections need to be tested.
Here is an example method:
private void continuousFromStopPoint(int i) { switch (i) { case 0: startAppReg(); break; case 1: startGCMReg(); break; case 2: startAppRegUpdate(); break; } } Depending on the value, it calls one method or another. And I donβt even have an idea how to test it.
Or this method seems to be more interesting:
private boolean isWasFinished(JSONObject jsonObject) { boolean wasFinished = false; try { if (jsonObject != null) { wasFinished = jsonObject.getBoolean(WAS_FINISHED); } } catch (JSONException e) { e.printStackTrace(); } return wasFinished; } Here it is already possible to check the return value, but then again, what to check it for when I don't care which value returns. If true code will do one, if false then another. What to check?
Tell me how to figure it out?
onCreate()and have logic in them, so why not test them? SoonCreate() -> privat() (ΡΠ»ΠΎΠΆΠ½Π°Ρ Π»ΠΎΠ³ΠΈΠΊΠ°) -> privat() (ΡΠ»ΠΎΠΆΠ½Π°Ρ Π»ΠΎΠ³ΠΈΠΊΠ°) -> privat() (ΡΠ»ΠΎΠΆΠ½Π°Ρ Π»ΠΎΠ³ΠΈΠΊΠ°)such a class should be left without tests, right? - Aleksey Timoshchenko