[BUGFIX beta] Make mandatory setter more helpful.

While working on #9387 I noticed that no tests existed for `mandatory-setter`.  This PR adds a few small tests, and updates the assertion to be more helpful.