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 address | |
| Street | Village | Province | Postal Code | Location | | |
| 110 Prairie Way | Elkhorn | Manitoba | P5A 0A4 | (42, 88) | |
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 address | |
| Street | Village | Province | Postal Code | | |
| 110 Prairie Way | Elkhorn | Manitoba | P5A 0A4 | |
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 class Address | |
{ | |
[TableAliases("Street")] | |
public string Line1 { get; set; } | |
[TableAliases("Township", "Village", "Municipality")] | |
public string City { get; set; } | |
[TableAliases("Province")] | |
public string State { get; set; } |
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
[Then(@"the address is")] | |
public void ValidateAddress(Table table) | |
{ | |
table.CompareToInstance(_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
[Then(@"the address is")] | |
public void ValidateAddress(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); | |
} |
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 following address")] | |
public void GivenTheFollowingAddress(Table table) | |
{ | |
Address address = table.CreateInstance<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
[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"]; |
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
# A horizontal table | |
| Line 1 | City | State | Zipcode | | |
| 30 Rockefeller Plaza | New York | NY | 10112 | | |
| 311 South Wacker Dr | Chicago | IL | 60606 | |
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
# A vertical table | |
| Field | Value | | |
| Line 1 | 30 Rockefeller Plaza | | |
| City | New York | | |
| State | NY | | |
| Zipcode | 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
[StepArgumentTransformation(@"(\d+)(?:st|nd|rd|th)")] | |
public int GetIndex(int index) | |
{ | |
return index - 1; | |
} | |
[When(@"I remove the (.*) product")] | |
public void RemoveProduct(int index) | |
{ | |
_products.RemoveAt(index); |