[英]Slim .net: How do I debug test fixtures using visual studio?
I've figured out how to run my tests from the commandline using: 我已经弄清楚如何使用命令行运行我的测试:
java -jar fitnesse.jar -c MyFixturePage?test&format=text -d "c:/utils/fitnesse/" -r "FitNesseRoot"
Using this as the startup parameters for my Fixture assembly project in visual studio does not work. 在Visual Studio 中将此作为我的Fixture装配项目的启动参数不起作用。 I'm using the Slim runner and executor in my fixtures : http://github.com/jediwhale/fitsharp/downloads
我在我的灯具中使用了Slim runner和executor: http : //github.com/jediwhale/fitsharp/downloads
Has any one worked out how to get debugging with Slim working in Visual Studio? 有没有人研究过如何在Visual Studio中使用Slim进行调试?
The problem is that java spawns another process where your .NET code gets executed and then that process shuts down right away. 问题是java会生成另一个执行.NET代码的进程,然后该进程立即关闭。 Here's a way to get a hold of the process where the .NET code runs:
这是一种了解.NET代码运行过程的方法:
http://www.asoftwarecraft.com/2010/01/troubleshooting-with-fitsharp-and.html http://www.asoftwarecraft.com/2010/01/troubleshooting-with-fitsharp-and.html
Another good way is to simply introduce a assertion that launches the debugger. 另一个好方法是简单地引入一个启动调试器的断言。 In our code all of our fixtures derive from some simple custom base fixtures with some utilities in them like |debug|
在我们的代码中,我们所有的灯具都来自一些简单的自定义基础灯具,其中包含一些实用程序,如| debug |
this assertion just launches the debugger like so: 这个断言只是启动调试器,如下所示:
public void Debug()
{
System.Diagnostics.Debugger.Launch();
}
as soon as the assertion is hit the debugger launches. 一旦断言被调用,调试器就会启动。
this has the advantage in that you can quickly pop it in wherever you like. 这样做的好处在于,您可以快速将其弹出到您喜欢的任何位置。 Sometimes you might have a long test that uses the same assertions over and over, in which case this is nice because you can do it right before the one that's the problem.
有时您可能会进行长时间的测试,反复使用相同的断言,在这种情况下,这很好,因为您可以在问题出现之前做到这一点。
I created a simple utility that calls Debbuger.Launch without needing to change the code or the FitNesse script. 我创建了一个简单的实用程序,无需更改代码或FitNesse脚本即可调用Debbuger.Launch。 This is very useful if your code and fitnesse scripts reside in source-control.
如果您的代码和fitnesse脚本驻留在源代码控制中,这非常有用。 See this blog post for more details.
有关详细信息,请参阅此博客文章 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.