如何在 Fitnesse 测试中传递空值?
我正在使用健身/健身。我有一个看起来像这样的柱固定装置。
!|Get Stepstools Medication Id From Vocab and String| |Concept As String|Vocabulary Name Abbr|Vocabulary Concept Id|Stepstools Med Id?| |AMOXICILLIN|RXNORM|723|1| |AMOXICILLIN| | |1| |AUGMENTIN|RXNORM|151392|8| |AUGMENTIN| | |8| |Amoxicillin 1000 MG / Clavulanate 62.5 MG Extended Release Tablet| | |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;
}
}
}
如何让测试使用空字符串值?
I'm using Fit/Fitnesse. I have a column fixture that looks like this.
!|Get Stepstools Medication Id From Vocab and String| |Concept As String|Vocabulary Name Abbr|Vocabulary Concept Id|Stepstools Med Id?| |AMOXICILLIN|RXNORM|723|1| |AMOXICILLIN| | |1| |AUGMENTIN|RXNORM|151392|8| |AUGMENTIN| | |8| |Amoxicillin 1000 MG / Clavulanate 62.5 MG Extended Release Tablet| | |8|
I'm trying to pass in empty string values by using | |
but the test, when I run it, takes the value from the previous row and uses that instead.
My fixture code looks like this:
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;
}
}
}
How do I get the test to use the empty string values?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了。而不是只使用“||”甚至“| |”,如果意图是空字符串,Fitnesse 期望关键字“blank”。所以修改后的测试如下所示:
I found it. Instead of using just "||" or even "| |", Fitnesse expects the keyword "blank" if an empty string is the intent. So the revised test looks like this: