FitNesse
.
DotNet
.
SuiteAcceptanceTests
.
SuiteTypeConversionTests
.
TestCustomTypeConversion
Edit Page:
!3 The [[!-DotNet-!][.FitNesse.DotNet]] Fit server will instantiate an instance of any class that exports a static Parse method that accepts a string and overrides !-ToString()-!. ---- |person fixture| |field|field?|property|property?|set|get?| |john doe|john doe|jane roe|jane roe|do remi|do remi| ---- {{{ public class PeopleFixture : ColumnFixture { public Person Field; public Person Property { get { return Field; } set { Field = value; } } public Person Get() { return Field; } public void Set(Person value) { Field = value; } } public class Person { private string firstName; private string lastName; public static Person Parse(string name) { string[] names = name.Split(' '); return new Person(names[0], names[1]); } public Person(string firstName, string lastName) { this.firstName = firstName; this.lastName = lastName; } public override string ToString() { return firstName + " " + lastName; } } }}}
Hints:
Use alt+s (Windows) or control+s (Mac OS X) to save your changes. Or, tab from the text area to the "Save" button!
Grab the lower-right corner of the text area to increase its size (works with some browsers).