我正在使用 Fit/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|
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;
}
}
}
如何让测试使用空字符串值?
最佳答案
我找到了。而不是只使用“||”甚至“| |”,如果意图是空字符串,Fitnesse 期望关键字“blank”。所以修改后的测试看起来像这样:
!|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|blank|blank|1|
|AUGMENTIN|RXNORM|151392|8|
|AUGMENTIN|blank|blank|8|
|Amoxicillin 1000 MG / Clavulanate 62.5 MG Extended Release Tablet|blank|blank|8|
关于c# - 如何在 Fitnesse 测试中传递空值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2541160/