首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何创建用于单元测试的CellInfo对象?

如何创建用于单元测试的CellInfo对象?
EN

Stack Overflow用户
提问于 2020-07-08 12:59:02
回答 1查看 37关注 0票数 0

我正在写单元测试用例,我不能理解的是,我如何创建一个CellinfoGsm或任何技术的虚拟对象,并从中测试我的代码。我读过文档和CellInfo的基类,但我不明白如何使用创建器,谁能给我一个例子,如何用我自己的值制作我自己的对象用于测试。任何帮助都将不胜感激。

EN

回答 1

Stack Overflow用户

发布于 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);

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62787859

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档