The .NET 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;
}
}
[Front Page] [Recent Changes]