title: Unit test an action on UITextField
body: <p>I have a simple if condition that, when met, adds a target to drop the keyboard when "Done" is tapped</p>
  
  <pre><code>- (void)addDoneWhenTrue:(UITextField *)input
  {
      if (YES)
      {
          [input addTarget:self action:@selector(textFieldFinished:) forControlEvents:UIControlEventEditingDidEndOnExit];
      }
  }
  
  - (IBAction)textFieldFinished:(id)sender
  {
      [sender resignFirstResponder];
  }
  </code></pre>
  
  <p>I'm using OCMock and OCUnit on iOS5. How can I create a unit test that allows me to pass in a simple <code>UITextField</code> input and simulate tapping the done button on it to verify that <code>resignFirstResponder</code> does happen (or not)?</p>