[Test]
Public void Analyze_TooShortFileName_ErrorLoggedToService()
{
MockRepository mocks = new MockRepository();
IWebService simulatedService =
mocks.CreateMock<IWebService>();
//pre-arrange setting
using(mocks.Record())
{
simulatedService.LogError("file name was too short ");
}
//play
LogAnalyzer log = new LogAnalyzer(simulatedService);
string tooShortFileName="abc.ext";
log.Analyze(tooShortFileName);
//verify
mocks.VerifyAll();
}
Tuesday, January 20, 2009
An Example of Mock
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment