警告
【Caveat】
为了与其他模拟 API 保持一致,该函数将属性的获取和设置都视为访问。如果属性设置发生在相同的访问索引上,“一次性”值将被设置操作消耗,并且被模拟的属性值将更改为该“一次性”值。如果你打算“一次性”值仅用于获取操作,这可能会导致意外行为。
【For consistency with the rest of the mocking API, this function treats both property gets and sets as accesses. If a property set occurs at the same access index, the "once" value will be consumed by the set operation, and the mocked property value will be changed to the "once" value. This may lead to unexpected behavior if you intend the "once" value to only be used for a get operation.】