12 2023 档案
摘要:3. Mockito 中常用注解 3.1 可以代替 Mock 方法的 @Mock 注解 Shorthand for mocks creation - @Mock annotation Important! This needs to be somewhere in the base class or
阅读全文
摘要:1. 为什么要使用 mock Mock 可以理解为创建一个虚假的对象,或者说模拟出一个对象,在测试环境中用来替换掉真实的对象,以达到我们可以: 验证该对象的某些方法的调用情况,调用了多少次,参数是多少 给这个对象的行为做一个定义,来指定返回结果或者指定特定的动作 2. Mockito 中常用方法 2
阅读全文
摘要:To access this from an outer scope (a class, extension function, or labeled function literal with receiver) you write this@label, where @label is a la
阅读全文