Tuesday, February 27, 2007

log4net and NUnit

I could not get NUnit to work with log4net today. I had tests (that did not have logging in) that called application code (that did have logging in), but whatever I did the tests did not log anything. I turns out that the test fixture must have a logger in it, for example:
[TestFixture, Category("Exchange")]
public class TestExchangeApplication : ApplicationTest
{
 static readonly ILog log = LogManager.GetLogger(typeof (TestExchangeApplication).Name);
.....

0 Comments:

Post a Comment

<< Home