我正在写单元测试用例,我不能理解的是,我如何创建一个CellinfoGsm或任何技术的虚拟对象,并从中测试我的代码。我读过文档和CellInfo的基类,但我不明白如何使用创建器,谁能给我一个例子,如何用我自己的值制作我自己的对象用于测试。任何帮助都将不胜感激。
发布于 2020-07-08 13:06:32
我对Android不是很感兴趣,现在只是想学点东西。你能让它像这样工作吗?->
mirror.android.telephony.CellInfoGsm.mCellSignalStrengthGsm.get(gsm);mirror.android.telephony.CellIdentityGsm.mMcc.set(identityGsm,gsm = mirror.android.telephony.CellInfoGsm.ctor.newInstance();mirror.android.telephony.CellIdentityGsm.mLac.set(identityGsm,strengthGsm = mirror.android.telephony.CellInfoGsm.mCellIdentityGsm.get(gsm);CellSignalStrengthGsm strengthGsm=mirror.android.telephony.CellIdentityGsm.mLac.set(identityGsm,cell.lac);gsm=mirror.android.telephony.CellInfoGsm.ctor.newInstance();gsm=mirror.android.telephony.CellInfoGsm.mCellIdentityGsm.get(gsm);CellSignalStrengthGsm strengthGsm=mirror.android.telephony.CellIdentityGsm.mLac.set(identityGsm,cell.lac);CellInfoGsm gsm=mirror.android.telephony.CellInfoGsm.mCellIdentityGsm.get(gsm);CellSignalStrengthGsm strengthGsm=mirror.android.telephony.CellIdentityGsm.mLac.set(identityGsm,cell.lac);CellInfoGsm gsm=mirror.android.telephony.CellInfoGsm.mCellIdentityGsm.get(gsm);CellSignalStrengthGsm strengthGsm=mirror.android.telephony.CellIdentityGsm.mLac.set(identityGsm,cell.lac);mirror.android.telephony.CellSignalStrengthGsm.mSignalStrength.set(strengthGsm,20);mirror.android.telephony.CellSignalStrengthGsm.mBitErrorRate.set(strengthGsm,0);
https://stackoverflow.com/questions/62787859
复制相似问题