I have a function which creates a report and sends it to a user. What I\'ve done is create a mock for the email function, and verify if the \'send\' function of the email class
In your unit test tell your mocking framework to expect a call to Send()
with a specific body text.
Example for Rhino Mocks:
var mockMail = MockRepository.GenerateMock();
mockMail.Expect( m => m.Send("ExpectedFrom", "ExpectedTo", "ExpectedSubject", "ExpectedBodytext") );
mockMail.Send(...whatever...);
mockProvider.VerifyAllExpectations();