exercism / exercism/csharp

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

Aberta
#1,845 1 comentário 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
C#
Estrelas
427
Forks
383
Merge médio
2d 2h
PRs com merge (30d)
5

Descrição

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]);

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.