2010-01-11 101 views
1

是否有'標準'方法來引入對Log4Net輸出的斷言?Log4Net的Asserting Appender?

E.g.

NUnit.Log4Net.Checkpoint() 

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

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

或者

NUnit.Log4Net.Checkpoint() 

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

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

我可以代碼log4net的一個斷言附加目的地,但認爲一定有什麼東西在那裏了嗎?

回答

2

目前沒有這樣的事情(根據谷歌)。

我們正在做的是thisthis的組合。基本上,我們已經建立了一些擴展方法,使我們能夠對MemoryAppender進行簡單的斷言。