FitNesse. UserGuide. DotNet. SuiteAcceptanceTests. SuiteCellHandlerTests. SuiteDefaultCellHandlerTests.
TestBlankAndNullKeywords [add child]

Empty cells should display the value of a field or property. If a cell contains "blank" or "null" then treat it as blank ("") or truly null.


Empty cells are automatically filled with the value of the field or property, and no check is performed. To explicitly set a value to empty string ("") or null, or to check for empty string or null, use the "blank" and "null" keywords.

This works in column fixtures...
fitlibrary.spec.SpecifyFixture
string fixture
field field field? field? field?
null   null blank joe
blank   null blank joe
joe   null blank joe
string fixture
field field field? field? field?
null   null null blank expected
null actual
joe expected
null actual
blank   blank null expected
actual
blank joe expected
actual
joe   joe null expected
joe actual
blank expected
joe actual
joe

...row fixtures...
fitlibrary.spec.SpecifyFixture
blank and null keyword row fixture
field property get field property get field property get
null null null blank blank blank Joe Joe Joe
blank blank blank Joe Joe Joe null null null
Joe Joe Joe null null null blank blank blank
blank and null keyword row fixture
field property get field property get field property get
null null null blank expected
null actual
blank expected
null actual
blank expected
null actual
Joe expected
null actual
Joe expected
null actual
Joe expected
null actual
blank blank blank Joe expected
actual
Joe expected
actual
Joe expected
actual
null expected
actual
null expected
actual
null expected
actual
Joe Joe Joe null expected
Joe actual
null expected
Joe actual
null expected
Joe actual
blank expected
Joe actual
blank expected
Joe actual
blank expected
Joe actual


public class BlankAndNullKeywordRowFixture : RowFixture
{
public override object[] Query()
{
StringFixture fixture1 = new StringFixture();
fixture1.Field = null;
fixture1.Property = null;
fixture1.Set(null);
StringFixture fixture2 = new StringFixture();
fixture2.Field = "";
fixture2.Property = "";
fixture2.Set("");
StringFixture fixture3 = new StringFixture();
fixture3.Field = "Joe";
fixture3.Property = "Joe";
fixture3.Set("Joe");
return new object[]{fixture1, fixture2, fixture3};
}

public override Type GetTargetClass()
{
return typeof(StringFixture);
}
}


...and action fixtures...
fitlibrary.spec.SpecifyFixture
action fixture
start string fixture
enter field null
check field  
check field null
check field blank
check field Joe
action fixture
start string fixture
enter field null
check field   null
check field null
check field blank expected
null actual
check field Joe expected
null actual

fitlibrary.spec.SpecifyFixture
action fixture
start string fixture
enter field blank
check field  
check field null
check field blank
check field Joe
action fixture
start string fixture
enter field blank
check field   blank
check field null expected
actual
check field blank
check field Joe expected
actual

fitlibrary.spec.SpecifyFixture
action fixture
start string fixture
enter field Joe
check field  
check field null
check field blank
check field Joe
action fixture
start string fixture
enter field Joe
check field   Joe
check field null expected
Joe actual
check field blank expected
Joe actual
check field Joe

 Tear Down: .FitNesse.UserGuide.DotNet.SuiteAcceptanceTests.TearDown (edit)