Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save joebuschmann/c1d100d0f14718a10fe4 to your computer and use it in GitHub Desktop.

Select an option

Save joebuschmann/c1d100d0f14718a10fe4 to your computer and use it in GitHub Desktop.
When building complex test data - not that
[Given(@"the customer")]
public void GivenTheCustomer(Table table)
{
Customer customer = table.CreateInstance<Customer>();
string[] addressParts = table.Rows[0]["Address"].Split(';');
Address address = new Address();
address.Line1 = addressParts[0];
address.Line2 = addressParts[1];
address.City = addressParts[2];
address.State = addressParts[3];
address.Zipcode = addressParts[4];
customer.Address = address;
_customer = customer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment