FitNesse. UserGuide. DotNet. SuiteAcceptanceTests. SuiteFixtureTests.
TestFixtureParameters [add child]

In a row fixture or column fixture, any cells in the first row after the cell with the name of the fixture, are treated as arguments against parameters defined within the fixture.


As shown in both of these examples, you access the text in these cells using a protected IList named Args:

parameterized column fixture string value 2 true Joe Zawinul
string field? int field? bool field? person field?
string value 2 true Joe Zawinul

using fit;

namespace fitnesse.acceptanceTests
{
public class ParameterizedColumnFixture : ColumnFixture
{
public string StringField;
public int IntField;
public bool BoolField;
public Person PersonField;

public override void Execute()
{
StringField = (string) new TypeAdapter(typeof(string)).Parse(Args[0]);
IntField = (int) new TypeAdapter(typeof(int)).Parse(Args[1]);
BoolField = (bool) new TypeAdapter(typeof(bool)).Parse(Args[2]);
PersonField = (Person) new TypeAdapter(typeof(Person)).Parse(Args[3]);
}
}
}

parameterized row fixture string value 2 True Joe Zawinul
value
string value
2
True
Joe Zawinul

using System;
using System.Collections;
using fit;

namespace fitnesse.acceptanceTests
{
public class ParameterizedRowFixture : RowFixture
{
public override object[] Query()
{
ArrayList list = new ArrayList();
list.Add(new ValueWrapper(new TypeAdapter(typeof(string)).Parse(Args[0])));
list.Add(new ValueWrapper(new TypeAdapter(typeof(int)).Parse(Args[1])));
list.Add(new ValueWrapper(new TypeAdapter(typeof(bool)).Parse(Args[2])));
list.Add(new ValueWrapper(new TypeAdapter(typeof(Person)).Parse(Args[3])));
return list.ToArray();
}

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

public class ValueWrapper
{
private object value;

public ValueWrapper(object value)
{
this.value = value;
}

public object Value
{
get { return value.ToString(); }
}
}
}

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