【发布时间】:2010-02-06 16:33:52
【问题描述】:
我正在使用 Cruise Control.NET 和 NAnt 在我们的代码库上自动运行 NUnit 测试。某些测试会导致显示 Windows 窗体。当这些测试从 VS 或 NUnit GUI 手动运行时,它们可以正常工作。通过 Cruise Control 服务运行时,出现以下异常:
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 在从服务调用时运行这些测试吗?
【问题讨论】: