6

我正在使用健身/健身。我有一个看起来像这样的柱夹具。

!|从词汇和字符串中获取 Stepstools 药物 ID|  
|作为字符串的概念|词汇名称缩写|词汇概念 ID|Stepstools Med Id?|  
|阿莫西林|RXNORM|723|1|  
|阿莫西林| | |1|  
|AUGMENTIN|RXNORM|151392|8|  
|奥格门汀| | |8|  
|阿莫西林 1000 MG / 克拉维酸 62.5 MG 缓释片| | |8|

我试图通过使用传递空字符串值,| |但是当我运行它时,测试会从前一行中获取值并使用它。

我的夹具代码如下所示:

public class GetStepstoolsMedicationIdFromVocabAndString: ColumnFixture
{
    public string VocabularyNameAbbr;
    public string VocabularyConceptId;
    public string ConceptAsString;

    public string StepStoolsMedId()
    {
        MedicationMapping mapping = MedicationMapper.GetStepMedIdFromVocabNameIdAndStringMed(
            VocabularyNameAbbr, 
            VocabularyConceptId, 
            ConceptAsString
            );

        if (mapping.SuccessfullyMapped)
        {
            return mapping.StepstoolsMedicationId.ToString();
        }
        else 
        {
            return mapping.ErrorMessage;
        }
    }
}

如何让测试使用空字符串值?

4

1 回答 1

6

我找到了。而不是只使用“||” 甚至“| |”,如果意图是空字符串,Fitnesse 需要关键字“空白”。所以修改后的测试是这样的:

!|从词汇和字符串中获取 Stepstools 药物 ID|
|作为字符串的概念|词汇名称缩写|词汇概念 ID|Stepstools Med Id?|
|阿莫西林|RXNORM|723|1|
|阿莫西林|空白|空白|1|
|AUGMENTIN|RXNORM|151392|8|
|AUGMENTIN|空白|空白|8|
|阿莫西林 1000 MG / 克拉维酸 62.5 MG 缓释片|空白|空白|8|

于 2010-03-29T20:57:13.337 回答