Skip to content

Instantly share code, notes, and snippets.

@follesoe
Created April 19, 2010 21:03
Show Gist options
  • Save follesoe/371625 to your computer and use it in GitHub Desktop.
Save follesoe/371625 to your computer and use it in GitHub Desktop.
[TestMethod]
public void Fires_event_when_recording_is_complete()
{
string filename = null;
viewModel.RecordingComplete += (o, e) => filename = e.Filename;
viewModel.RecordingCommand.Execute(null); // Start recording
viewModel.RecordingCommand.Execute(null); // Stop recording
Assert.IsNotNull(filename, "Should fire event when recording is complete.");
}
// Causing an event to raise automatically when Submit is invoked
mock.Setup(foo => foo.Submit()).Raises(f => f.Sent += null, EventArgs.Empty);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment