This file contains 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
using NUnit.Framework; | |
[assembly: Parallelizable(ParallelScope.Fixtures)] |
This file contains 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
private readonly ScenarioContext _scenarioContext; | |
public AddressSteps(ScenarioContext scenarioContext) | |
{ | |
_scenarioContext = scenarioContext; | |
} |
This file contains 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
private readonly ScenarioContext _scenarioContext | |
= ScenarioContext.Current; |
This file contains 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
[BeforeTestRun] | |
public static void RegisterValueMappings() | |
{ | |
var geoLocationValueHandler = new GeoLocationValueHandler(); | |
Service.Instance.RegisterValueRetriever(geoLocationValueHandler); | |
Service.Instance.RegisterValueComparer(geoLocationValueHandler); | |
} |
This file contains 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: Build a customer | |
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 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: Build a customer | |
Given the customer | |
| Name | Address | | |
| Miss Liz Lemon | 30 Rockefeller Plaza; New York; NY; 10112 | |
This file contains 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 bool CanCompare(object actualValue) | |
{ | |
return actualValue is GeoLocation; | |
} | |
public bool Compare(string expectedValue, object actualValue) | |
{ | |
GeoLocation expectedLocation; | |
if (TryGetLocation(expectedValue, out expectedLocation)) |
This file contains 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 bool CanRetrieve(KeyValuePair<string, string> keyValuePair, | |
Type targetType, Type propertyType) | |
{ | |
return propertyType == typeof(GeoLocation); | |
} | |
public object Retrieve(KeyValuePair<string, string> keyValuePair, | |
Type targetType, Type propertyType) | |
{ | |
string coordinates = keyValuePair.Value; |
This file contains 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")] | |
public string City { get; set; } | |
[TableAliases("Province")] | |
public string State { get; set; } |
This file contains 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) | |
NewerOlder