How do I pass in empty values in Fitnesse test?
Asked Answered
B

1

6

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?

Benjie answered 29/3, 2010 at 20:46 Comment(0)
B
7

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:

!|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|

Benjie answered 29/3, 2010 at 20:57 Comment(1)
Another useful keyword is null for setting an input to null, as opposed to setting it to an empty string, which is what blank does.Intercessory

© 2022 - 2024 — McMap. All rights reserved.