public static void Returns_an_empty_dictionary_for_an_empty_name_value_collection() { var emptyCollection = new NameValueCollection(); IEnumerable<KeyValuePair<string, string>> keyValuePairs = emptyCollection.ToKeyValuePairs(); keyValuePairs.Should().BeEmpty(); }
public static void Returned_dictionary_contains_exactly_the_elements_from_the_name_value_collection() { var collection = new NameValueCollection { { "a", "1" }, { "b", "2" }, { "c", "3" } }; IEnumerable<KeyValuePair<string, string>> keyValuePairs = collection.ToKeyValuePairs(); keyValuePairs.Should().Equal(new[] { new KeyValuePair<string, string>("a", "1"), new KeyValuePair<string, string>("b", "2"), new KeyValuePair<string, string>("c", "3") }); }