警告


¥Caveat

为了与其余模拟 API 保持一致,此函数将属性的获取和设置都视为访问。如果属性集出现在相同的访问索引处,则设置操作将使用 "once" 值,并且模拟属性值将更改为 "once" 值。如果你打算仅将 "once" 值用于 get 操作,这可能会导致意外行为。

¥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.