Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

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

Select an option

Save joebuschmann/a238cb7fcd234eb5432b to your computer and use it in GitHub Desktop.
When sharing state between bindings - code this
private Customer _customer;
private Response _response;
[Given(@"the new customer")]
public void GivenTheNewCustomer(Table table)
{
_customer = table.CreateInstance<Customer>();
}
[Given(@"the customer's address")]
public void GivenTheCustomerAddress(Table table)
{
_customer.Address = table.CreateInstance<Address>();
}
[When(@"I save the customer")]
public void WhenISaveTheCustomer()
{
_response = _serviceProxy.Post(_customer);
}
[Then(@"a successful response should be returned")]
public void ThenASuccessfulResponseShouldBeReturned()
{
Assert.That(_response.IsSuccessful, Is.True);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment