0

我将 Fitnesse 与 Michael Sorens 文章的 CleanCodeFixtures 一起使用, Acceptance Testing with Fitnesse
我认为代码是正确的,Fitnesse 页面是正确的,这与我的设置有关。

概述
Michael 的 Fitnesse 页面是指没有“Fixture”后缀的灯具。在许多地方,这很好用,但在许多地方却不行。
CleanCodeFixtures.Common.Diagnostic 与 CleanCodeFixtures.Common.DiagnosticFixture 相对。
如何调试这种情况?

DETAILS
!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 是有效的,但没有解释为什么它在没有它的情况下适用于许多其他固定装置。
关于如何调试的任何想法?

4

2 回答 2

0

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

!path /path/to/your.dll

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

!|import |
|CleanCodeFixtures.Common.Diagnostic|

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

于 2016-04-19T03:31:45.667 回答
0

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

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

于 2016-04-22T16:44:52.650 回答