views:

77

answers:

1

Is there a 'standard' way to introduce assertions against Log4Net output?

E.g.

NUnit.Log4Net.Checkpoint()

...run some code that should not throw warnings...

NUnit.Log4Net.AssertNoErrors()
NUnit.Log4Net.AssertNoErrorsOrWarnings()

Or

NUnit.Log4Net.Checkpoint()

...code that warns user about an obsolete value...

NUnit.Log4Net.AssertOneWarnings("obsolete value used")

I could code an asserting appender for Log4Net but thought there must be something out there already?

+1  A: 

There is currently no such thing (according to Google).

What we're doing is a combination of this and this. Basically, we've built some extension methods that enables us to do simple asserts against a MemoryAppender.

Peter Lillevold