A mock appender sounds like a good idea for our tests. Currently the tests use a combination of different appenders, but mostly the CountingAppender. http://cvs.apache.org/viewcvs.cgi/logging-log4net/tests/src/Appender/CountingAppender.cs
To submit your mock appender please use the issue tracking system. http://issues.apache.org/jira/browse/LOG4NET Create a new issue for your patch. On the log4net issues home page select the Create New Issue from the menu bar. You will need to be logged into JIRA in order to create an issue. Select the issue type as appropriate. Prefix the summary with [PATCH]. Enter a description of the changes made, new features, or bug fixes in your patch. Once the issue has been created you can attach your patch file to the issue by selecting the Attach file to this issue operation from the left hand menu. When attaching your patch you must select the Grant license to ASF for inclusion in ASF works option. If attaching a patch please include in the description the baseline version of log4net you used to build your patch, if against a CVS version please include the date and branch (e.g. HEAD). If you have other files to attach, e.g. you have added new files to log4net, then attach each file separately. Please include in the description the name of the file attached and the path it should live in the project. Cheers, Nicko > -----Original Message----- > From: Thibaut Barr�re [mailto:[EMAIL PROTECTED] > Sent: 27 April 2005 19:29 > To: Log4NET User > Subject: A mock log4net appender > > Hi, > > I wrote a mock log4net appender to ensure that my unit tests > fails when some errors are (sometimes silently) logged > through log4net. > > Sample usage in NUnit style: > > [SetUp] > public void SetUp() > { > DOMConfigurator.Configure(); > > // create a mock log4net appender to verify that no > error is outputted > mockLog4netAppender = new MockLog4netAppender(); > // expect zero errors > mockLog4netAppender.ExpectErrors(0); > mockLog4netAppender.RegisterAppender(); > } > > [TearDown] > public void TearDown() > { > // verify that no error was outputed by log4net > mockLog4netAppender.Verify(); > } > > > Current implementation is very basic, and depends upon NMock; > it's actually a specialized DynamicMock, so specific > expectations can be added in each test when required. > > Is there some interest for including tools of this kind in > the log4net distribution (either as a static mock, or a > dynamic mock) ? Or is there an already available feature > which could provide the same service ? > > > best regards > > Thibaut Barr�re > > http://www.dotnetguru2.org/tbarrere >
