0
我試圖從我的XUnit 2.x unit單元測試單元測試會話的Resharper輸出中顯示nhibernate的sql語句,但它記錄了sql語句。如何使用resharper和xunit捕獲NHibernate的SQL語句2
With MSpec Tests沒有問題,並顯示SQL語句。用XUnit 1.x我想sql語句也被記錄下來。
我已經通過性能配置NHibernate的show_sql
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>
有中的xUnit 2輸出如何獲取a change,但我不知道如何這與NHibernate結合記錄的SQL語句。
那麼有誰有這個解決方案嗎?我試圖在我的unittests中避免log4net集成,只記錄這些語句。
的xUnit 2.1, NHibernate的4.0, ReSharper的2016年3月1日, 的Visual Studio 2013
這裏建議這可能與的xUnit的'ITestOutputHelper'和攔截成爲可能:http://stackoverflow.com/a/2874025/1162077 –