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 new customer")] | |
| public void GivenTheNewCustomer(Table table) | |
| { | |
| var customer = table.CreateInstance<Customer>(); | |
| ScenarioContext.Current.Add("customer", customer); | |
| } | |
| [Given(@"the customer's address")] | |
| public void GivenTheCustomerAddress(Table table) | |
| { |
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 (\d+)(?:st|nd|rd|th) product")] | |
| public void WhenIRemoveTheProduct(int index) | |
| { | |
| _products.RemoveAt(--index); | |
| } |
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 at index (.*)")] | |
| public void WhenIRemoveTheProductAtIndex(int index) | |
| { | |
| _products.RemoveAt(--index); | |
| } |
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(@"from (A-Z|Z-A)")] | |
| public SortOrder SortOrderTransform(string sortOrderPhrase) | |
| { | |
| if (sortOrderPhrase == "Z-A") | |
| return SortOrder.Descending; | |
| return SortOrder.Ascending; | |
| } | |
| [When(@"the products are sorted by name (.*)")] |
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(@"the products are sorted by name (.*)")] | |
| public void WhenTheProductsAreSortedByName(string sortOrderText) | |
| { | |
| SortOrder sortOrder = SortOrder.Ascending; | |
| if (sortOrderText == "from A-Z") | |
| sortOrder = SortOrder.Ascending; | |
| else if (sortOrderText == "from Z-A") | |
| sortOrder = SortOrder.Descending; | |
| else |
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
| Background: | |
| Given I have the following products | |
| | Id | Name | | |
| | 45 | Galaxy S5 | | |
| | 46 | iPhone 6 | | |
| | 47 | Nokia Icon | | |
| Scenario: Update price | |
| When I select the Nokia Icon | |
| And update the price to $199.00 |
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(@"I have the following products")] | |
| public void GivenIHaveTheFollowingProducts(Table table) | |
| { | |
| _productIdLookup = new Dictionary<string, int>(); | |
| foreach (var row in table.Rows) | |
| _productIdLookup.Add(row["Name"], row.GetInt32("Id")); | |
| } | |
| [When(@"I select the (.*)")] |
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
| Scenario: Update price | |
| When I choose the product with ID 47 | |
| And update the price to $199.00 | |
| Then the price should be saved |
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 choose the product with ID (.*)")] | |
| public void WhenIChooseTheProductWithID(int productId) | |
| { | |
| _selectedProductId = productId; | |
| } |
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
| #!/bin/sh | |
| # whereis command for Windows. | |
| where "$@" |