The other day I started working on a WMI wrapper that would encapsulate workstation management functionality (starting and stopping services, querying workstations, etc.). Unit testing, as always, is important, but I inevitably came to one problem.
How do you unit test a method that reboots a workstation?
The answer: Run the unit test, and if your machine starts to shut down, that means it’s the end of the workday, and your test passed. (It was already 6PM on a Friday, so such behavior was justified.)