This question evaluates unit test design, mocking/stubbing of external APIs, deterministic simulation, and correctness of grid-navigation controller logic under edge cases, loops, performance limits, and API error behaviors.

Assume we are testing a controller that navigates a grid-based maze to find cheese. The controller drives an abstract Maze API and must return the first cheese it finds according to a deterministic neighbor-order policy. Multiple cheeses may exist; some may be unreachable.
You may minimally adjust the exact API shape but keep behavior semantically equivalent to the above.
Propose a comprehensive set of unit tests for the mouse-maze controller. Include tests for:
Also describe how to stub/simulate the Maze API deterministically to support these tests.
Login required