title: Unit-testing mouse event handlers
body: <p>When unit-testing a component, the following question occured to me:</p>
  
  <p>There are a number of mouse-related event handlers. I see two possibilties to test these handlers:</p>
  
  <ol>
  <li>Simulate mouse events using Windows API calls.</li>
  <li>Use the <a href="http://delphi.about.com/od/oopindelphi/l/aa082603a.htm" rel="nofollow">protected hack</a> to access protected event handlers and call them directly.</li>
  </ol>
  
  <p>I know that unit testing is normally restricted to the interface of a class (which also means that tests don't have to be changed when class internals change), but is this scenario worth an exception? </p>
  
  <p>How do you usually handle mouse events when unit-testing components?</p>