【问题标题】:How to debug Fitnesse setup如何调试 Fitnesse 设置
【发布时间】:2016-04-23 00:44:52
【问题描述】:

我正在使用来自 Michael Sorens 文章的带有 CleanCodeFixtures 的 Fitnesse, Acceptance Testing with 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|

似乎可以工作,但似乎没有任何改变。当它使用下一个表中的诊断类时,它会得到同样的错误。

CleanCodeFixtures.Common.Diagnostic
找不到夹具:CleanCodeFixtures.Common.Diagnostic。

我不知道它会如何找到 DLL,但找不到任何固定装置。

代码有一个 Diagnostic 类和一个 DiagnosticFixture 类。

namespace CleanCodeFixtures.Common
{
    public class Diagnostic

...

namespace CleanCodeFixtures.Common   
{
    public class DiagnosticFixture : ColumnFixture

更改 Fitnesse 页面以引用 DiagnosticFixture 明确有效,但没有解释为什么在没有它的情况下它适用于许多其他固定装置。
关于如何调试的任何想法?

【问题讨论】:

    标签: installation fitnesse fitsharp


    【解决方案1】:

    检查您的类路径设置以执行测试。如果您使用的是外部依赖项,则需要使用!path 语句将测试执行指向正确的位置以查找依赖项。尝试在您的测试页面上放置类似的内容(或层次结构中的内容):

    !path /path/to/your.dll
    

    在此之后,测试应该能够在类路径上找到夹具,但从您发布的代码来看,您似乎没有将夹具导入测试用例。为此:

    !|import |
    |CleanCodeFixtures.Common.Diagnostic|
    

    如果这两个步骤无法解决,请发布完整的测试页代码。

    【讨论】:

    • 在我的例子中,这给出了一个错误。看起来 import 是区分大小写的。
    • 将这两行添加到我的 root\content 文件中至少会改变结果。 !define COMMAND_PATTERN {%m -r Fitnesse.fitserver.FitServer,fitsharp\fit.dll %p} !define TEST_RUNNER {fitsharp\Runner.exe}
    • 这正在演变成一个新话题,所以我将它带到一个新问题:Fitnesse can't find type Begin in Fixture
    【解决方案2】:

    有效的术语是维基词。 “字数”会找到 WordCountFixture,但“诊断”不会找到 DiagnosticFixture。 把它变成一个 wiki 词,[Diagnostic],似乎已经修复了它。

    不确定为什么它适用于 Micheal 等人。似乎仍然是错误的解决方案。但它对我有用。我可以使用 wiki 词或明确指定 Fixture。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-06
      • 2017-11-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-06
      相关资源
      最近更新 更多