public void CopyKeyValuesWithDuplicateKeyThrowException() { // Arrange var source = new NameValueCollection { { "key1", "value1" } }; var dest = new NameValueCollection { { "key1", "value1" } }; // Act // Assert Assert.Throws<ApplicationException>(() => source.CopyKeyValues(dest)); }
public void UnableToCopyKeyValues() { // Arrange var source = new NameValueCollection { { "key1", "value1" }, { "key2", "value2" }, }; var dest = new NameValueCollection(); // Act source.CopyKeyValues(dest); // Assert Assert.IsTrue(dest["key1"] == "value1"); Assert.IsTrue(dest["key2"] == "value2"); }