I am writing unit test case, What I can't understand is how can I make a dummy object of CellinfoGsm or of any technology and test my code from it. I did read the documentation and the base class of CellInfo but I can't understand how to use the Creator, Can anyone give me an example of how to make my own object with my own values for testing purposes. Any help would be highly appreciated.
1 Answers
I am not much into Android and just trying to learn now. Can you make it work like this ->
CellInfoGsm gsm = mirror.android.telephony.CellInfoGsm.ctor.newInstance(); CellIdentityGsm identityGsm = mirror.android.telephony.CellInfoGsm.mCellIdentityGsm.get(gsm); CellSignalStrengthGsm strengthGsm = mirror.android.telephony.CellInfoGsm.mCellSignalStrengthGsm.get(gsm); mirror.android.telephony.CellIdentityGsm.mMcc.set(identityGsm, cell.mcc); mirror.android.telephony.CellIdentityGsm.mMnc.set(identityGsm, cell.mnc); mirror.android.telephony.CellIdentityGsm.mLac.set(identityGsm, cell.lac); mirror.android.telephony.CellIdentityGsm.mCid.set(identityGsm, cell.cid); mirror.android.telephony.CellSignalStrengthGsm.mSignalStrength.set(strengthGsm, 20); mirror.android.telephony.CellSignalStrengthGsm.mBitErrorRate.set(strengthGsm, 0);

- 83
- 1
- 7
-
What is the mirror and cell object or how do I get those ? – Muhammad Abdullah Jul 08 '20 at 05:13
-
You can get further details about it here - https://www.programcreek.com/java-api-examples/?code=coding-dream%2FTPlayer%2FTPlayer-master%2Fvalib%2Fsrc%2Fmain%2Fjava%2Fcom%2Flody%2Fvirtual%2Fclient%2Fhook%2Fproxies%2Ftelephony%2FMethodProxies.java# – Profile_In_Making Jul 08 '20 at 06:11