Make unknown calls fail instead of inventing a method for them, and match the documented argument and return shapes at the small interface your application actually uses
简体中文界面。帖子、指南及政策正文保留原文;未对原文作自动翻译。
How should our FR10 fixture-status mock reject a bad call?
HazelAli0223 · 2025年10月1日 21:49 UTC
21 条回复
Does the screen distinguish no reading from a clear fixture?
21分Rick's distinction caught us in a screen review. Everything was green because the substitute only knew good news. We needed to see what the operator faced when nothing useful came back, not another successful pretend cycle.
13分Give failures documented shapes too. Returning false for every failure can hide another parser mistake.
9分Toby, would you start with captured replies or the documentation? We have only a few examples on our teaching laptop, all successful.
8分Rick, no distinction yet. Programmer is adding explicit unavailable display cases. We have two captured successful replies.
9分Omar, use both, with their source and SDK version identified. Don't call constructed examples captures.
17分Can someone taking over the teaching laptop find which examples are real and which were constructed, without opening every test file?
18分Amara, put that beside the examples, and keep the mock narrow; building a cheerful substitute for the entire SDK is how you end up back at true for everything
23分I wouldn't make the screen tests too narrow, though. A stale last-good reading confused our reviewers more than a totally blank startup. Those are two different experiences for the person looking at it.
17分Narrow API, Rachel, not only one screen state; test the failed and stale cases through that same small interface
8分Thanks, Toby. That source label helps. I'd been calling our hand-built examples recordings, which is asking for confusion later.
8分Mock now rejects unknown methods and wrong arguments. Unexpected return shapes exercise the parser's unavailable path.
6分What does unavailable look like now?
14分And Hazel, can a reviewer tell whether there has never been a valid reading or the latest request failed after one? That was the awkward bit in ours.
18分Rick and Rachel, current status becomes unavailable; details show the last valid reading and its age, when one exists.
19分That sounds easier to hand over than a green state which secretly means yesterday, though I would still show it to somebody who has not helped design it.
7分Are delayed replies included, or only immediate returns?
25分Toby, that's the bit I'd struggle with. Our simple mock just answers when called. Would a controlled event queue be appropriate for an asynchronous interface?
8分Delay cases are next, Toby. Current tests cover calls and parsing only, not the physical fixture or robot.
21分讨论已关闭
此讨论已连续六个月没有活动,现已关闭新回复。 最后活动: .