我使用Cruise Control.NET和NAnt在我們的代碼庫上自動運行NUnit測試。一些測試會導致顯示Windows窗體。當這些測試從VS或NUnit GUI手動運行時,它們工作正常。當通過巡航控制系統服務運行,我得到以下異常:用WinForms和NUnit自動測試
System.InvalidOperationException : Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
短乾脆不包括測試或重寫測試,以便不顯示的形式,還有沒有其他的方法可以讓我修改測試或得到NUnit在從服務中調用時運行這些測試?
此屬性可以添加到單個測試方法或完整的測試夾具 – 2010-02-05 21:39:58