我正在为 Apex 批次编写测试类,但我只获得 35% 的测试覆盖率

发布于 2025-01-16 20:42:17 字数 1437 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最后的乘客 2025-01-23 20:42:17

insert opp; 行在哪里?没有机会,没有什么可以循环的。

在单元测试中,OpportunityHistory 表将为空白。您可能被迫在测试中使用 seeAllData=true 或使用 https:// salesforce.stackexchange.com/q/4007/799

Where's the insert opp; line? There are no opportunities, nothing to loop over.

And in unit test the OpportunityHistory table will be blank. You might be forced to use seeAllData=true in the test or use tricks such as https://salesforce.stackexchange.com/q/4007/799

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文