static private AddKey ( string>.IDictionary |
||
config | string>.IDictionary | |
logger | ILogger | |
receiver | string | |
id | string | |
value | string | |
return | void |
public void AddKey_AddsItem(string receiver, string id, string key) { // Arrange IDictionary <string, string> config = new Dictionary <string, string>(); // Act WebHookReceiverConfig.AddKey(config, _logger, receiver, id, "Value"); // Assert Assert.Equal("Value", config[key]); }
public void AddKey_ThrowsOnDuplicateKey() { // Arrange IDictionary <string, string> config = new Dictionary <string, string>(); WebHookReceiverConfig.AddKey(config, _logger, "Receiver", "Id", "Value"); // Act InvalidOperationException ioex = Assert.Throws <InvalidOperationException>(() => WebHookReceiverConfig.AddKey(config, _logger, "Receiver", "Id", "Value")); // Assert Assert.Equal("Could not add configuration for receiver 'Receiver' and id 'Id': An item with the same key has already been added.", ioex.Message); }