|
From: Steve F. <st...@m3...> - 2005-04-27 22:30:35
|
On 27 Apr 2005, at 13:09, Thibaut Barr=E8re wrote: > no answer so I assume it's too off-topic to be included in nmock ? (or > maybe only interesting for my own needs!;) not necessarily, just everyone's swamped... This isn't my call, but I wouldn't be keen to see this included in the=20= core package. There are a great many useful things out there that could=20= be mocked out and we learned the hard way with the java mockobjects.com=20= that this is a bottomless pit. You also need to be careful about asserting within the TearDown, which=20= should only be for cleaning up the fixture. In jUnit, at least,=20 exceptions are handled differently than from within the test itself. S. > 2005/4/25, Thibaut Barr=E8re <thi...@gm...>: >> Hi, >> >> I wrote a mock log4net appender to ensure that my tests fails when >> some errors are (sometimes silently) logged through log4net. >> >> Sample usage (just a starter): >> >> [SetUp] >> public void SetUp() >> { >> DOMConfigurator.Configure(); >> >> // create a mock log4net appender to verify that no error is=20= >> outputed >> mockLog4netAppender =3D new MockLog4netAppender(); >> // expect zero errors >> mockLog4netAppender.ExpectErrors(0); >> mockLog4netAppender.RegisterAppender(); >> } >> >> [TearDown] >> public void TearDown() >> { >> // verify that no error was outputed by log4net >> mockLog4netAppender.Verify(); >> } >> >> Do you think this idea could fit inside the nmock package ? I know >> it's slightly OT, but if you think it can be useful or have other >> remarks, please tell me. |