exercism / exercism/csharp

International Calling Connoisseur - Tests should check for correct handling of duplicate Add().

未关闭
#1,845 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C#
星标
427
派生
383
平均合并
2 天 2 小时
30 天内合并 PR
5

描述

Add() throws if the key is already in the dictionary. I saw a bunch of passing solutions that don't check for the key before calling Add().

In general, there's lots of ways for dictionaries to throw exceptions when you do naive-but-seemingly-reasonable things, and the "Intro-to-Dictionaries" text might want to call out the common ways to go wrong.

Example test:

var countryCodes = DialingCodes.AddCountryToExistingDictionary(DialingCodes.GetExistingDictionary(), 91, "India");
Assert.Equal("India", countryCodes[91]);

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。