This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[When(@"I remove the (.*) product")] | |
public void RemoveProduct(string position) | |
{ | |
// Position comes in as 1st, 2nd, 3rd, etc. | |
int index = ParsePosition(position); | |
// Snip | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Given("a new customer and address")] | |
public void GivenANewCustomerAndAddress() | |
{ | |
Customer customer = new Customer | |
{ | |
Salutation = "Miss", | |
FirstName = "Liz", | |
LastName = "Lemon" | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[StepArgumentTransformation("the address")] | |
public Address CreateAddress(Table table) | |
{ | |
return table.CreateInstance<Address>(); | |
} | |
[Given(@"the address")] | |
public void GivenTheAddress(Address address) | |
{ | |
_address = address; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[StepArgumentTransformation("the customer")] | |
public Customer CreateCustomer(Table table) | |
{ | |
return table.CreateInstance<Customer>(); | |
} | |
[Given(@"the customer")] | |
public void GivenTheCustomer(Customer customer) | |
{ | |
_customer = customer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Given("a new customer and address")] | |
public void GivenANewCustomerAndAddress() | |
{ | |
Table customer = new Table("FirstName", "LastName", "Salutation"); | |
customer.AddRow("Miss" "Liz", "Lemon"); | |
Table address = new Table("Line 1", "City", "State", "Zipcode"); | |
address.AddRow("30 Rockefeller Plaza", "New York", "NY", "10112"); | |
Given("the customer", customer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Given the customer | |
| Salutation | First Name | Last Name | | |
| Miss | Liz | Lemon | | |
And the address | |
| Line 1 | City | State | Zipcode | | |
| 30 Rockefeller Plaza | New York | NY | 10112 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class Steps | |
{ | |
// Built-in context | |
public ScenarioContext ScenarioContext { get; } | |
public FeatureContext FeatureContext { get; } | |
public TestThreadContext TestThreadContext { get; } | |
public ScenarioStepContext StepContext { get; } | |
// Call other binding steps | |
public void Given(string step); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Binding] | |
public sealed class AddressServiceSteps | |
{ | |
private readonly IBodySerializer _bodySerializer; | |
public ContentTypeSteps(IBodySerializer bodySerializer) | |
{ | |
_bodySerializer = bodySerializer; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[BeforeScenario("xml")] | |
public void ConfigureXml() | |
{ | |
_objectContainer | |
.RegisterTypeAs<XmlBodySerializer, IBodySerializer>(); | |
} | |
[BeforeScenario("json")] | |
public void ConfigureJson() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@json | |
Scenario: Invoke service with JSON payload | |
Given a fully populated request object | |
When I invoke the service | |
Then a valid response should be returned |