[英]How to debug Fitnesse setup
我正在使用Michael Sorens文章“ Fitnessit的验收测试”中带有 CleanCodeFixtures的Fitnesse 。
我认为代码是正确的,Fitnesse页面是正确的,并且这与我的设置有关。
总览
迈克尔(Michael)的Fitnesse(菲力特菲克)页面是指没有后缀“ Fixture”的灯具。 在很多地方,这种方法都行得通,但在许多地方却行不通。
CleanCodeFixtures.Common.Diagnostic与CleanCodeFixtures.Common.DiagnosticFixture相反。
如何调试这种情况?
细节
!path在Fitnesse \\ FitNesseRoot \\ content.txt中,并且dll在正确的目录中。 根据ProcMon,它正在查找dll。
!note .NET References
!path fitsharp\dbfit.dll
!path fitsharp\dbfit.sqlserver.dll
!path Fixtures\CleanCodeFixtures.dll
!path fitsharp\fit.dll
它仍然无法在dll中找到固定装置。
文件Fitnesse \\ FitNesseRoot \\ CleanCode \\ SuiteSetUp \\ content.txt包含
!|CleanCodeFixtures.Common.Diagnostic|
|Begin |
|${PAGE_NAME} |
!|import |
|dbfit.fixture |
|CleanCodeFixtures.Common |
|CleanCodeFixtures.ControlFlow|
|CleanCodeFixtures.Database |
!note This allows enabling/disabling debugging with the external command files !-EnableDebug.cmd and DisableDebug.cmd-!.
!|Debugger |
|Launch With External Trigger|
| |
它抱怨找不到固定装置。
找不到固定装置:CleanCodeFixtures.Common.Diagnostic。
找不到灯具:导入。
找不到固定装置:调试器。
在第一行之前添加
!|Import | ## note that it is case sensitive
|CleanCodeFixtures.Common.Diagnostic|
似乎可以工作,但似乎没有任何改变。 当它在下表中使用Diagnostic类时,将得到相同的错误。
CleanCodeFixtures.Common.Diagnostic
找不到固定装置:CleanCodeFixtures.Common.Diagnostic。
我无法弄清楚它将如何找到DLL,但找不到任何固定装置。
该代码具有Diagnostic类和DiagnosticFixture类。
namespace CleanCodeFixtures.Common
{
public class Diagnostic
...
namespace CleanCodeFixtures.Common
{
public class DiagnosticFixture : ColumnFixture
更改Fitnessfite页面以明确引用DiagnosticFixture是可行的,但没有解释为什么在许多其他灯具中不使用它就可以工作。
关于如何调试的任何想法?
检查您的类路径设置以执行测试。 如果使用的是外部依赖关系,则需要使用!path
语句将测试执行指向正确的位置以查找依赖关系。 尝试在您的测试页上放置这样的内容(或层次结构中的内容):
!path /path/to/your.dll
之后,测试应该能够在类路径上找到灯具,但是从您发布的代码来看,似乎您没有将灯具导入到测试用例中。 去做这个:
!|import |
|CleanCodeFixtures.Common.Diagnostic|
如果这两个步骤不能解决问题,请发布完整的测试页代码。
有效的术语是维基词。 “字数统计”将找到WordCountFixture,但“诊断”则找不到DiagnosticFixture。 使它成为Wiki单词[诊断]似乎已解决。
不确定为什么它适用于Micheal等。 似乎仍然是错误的解决方案。 但这对我有用。 我可以使用Wiki单词或明确指定Fixture前进。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.