Skip to content

Instantly share code, notes, and snippets.

@joebuschmann
Created December 29, 2014 18:44
Show Gist options
  • Select an option

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

Select an option

Save joebuschmann/b3ae7a70286fee811103 to your computer and use it in GitHub Desktop.
When working with tables - not that
[Given(@"the following address")]
public void GivenTheFollowingAddress(Table table)
{
Address address = new Address();
address.Line1 = table.Rows[0]["Line 1"];
address.Line2 = table.Rows[0]["Line 2"];
address.City = table.Rows[0]["City"];
address.State = table.Rows[0]["State"];
address.Zipcode = table.Rows[0]["Zipcode"];
}
[Then(@"the following address should be returned by the service")]
public void ThenTheFollowingAddressShouldBeReturnedByTheService(Table table)
{
Assert.AreEqual(table.Rows[0]["Line 1"], _address.Line1);
Assert.AreEqual(table.Rows[0]["Line 2"], _address.Line2);
Assert.AreEqual(table.Rows[0]["City"], _address.City);
Assert.AreEqual(table.Rows[0]["State"], _address.State);
Assert.AreEqual(table.Rows[0]["Zipcode"], _address.Zipcode);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment