exercism / exercism/csharp

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

オープン
#1,845 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C#
スター
427
フォーク
383
平均マージ
2日 2時間
マージ済み PR(30日)
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 を短くまとめたダイジェスト。