public void Successful_match_should_allow_getting_nullable_types_from_matches() { // given var matches = new Dictionary <string, object> { { "key", "5" } }; var templateMatches = new UriTemplateMatches(matches); // when var actualValue = templateMatches.Get <int?>("key"); // then actualValue.Should().Be(5); }
public void Successful_match_should_get_converted_values_for_existing_key() { // given var matches = new Dictionary <string, object> { { "key", "5" } }; var templateMatches = new UriTemplateMatches(matches); // when var actualValue = templateMatches.Get <int>("key"); // then actualValue.Should().Be(5); }
public void Successful_match_should_get_values_as_is_when_no_conversions_required() { // given var list = new List <int>(); var matches = new Dictionary <string, object> { { "key", list } }; var templateMatches = new UriTemplateMatches(matches); // when var actualValue = templateMatches.Get <List <int> >("key"); // then actualValue.Should().BeSameAs(list); }