You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 817f723
Browse filesBrowse the repository at this point in the historyBrowse files
Dictionary default value: retarget net10.0, fix mis-wired tests, drop dynamic
- All three projects retargeted net7.0 -> net10.0.
- Tests: four of six tests were named for MethodTryGetValue and MethodContainsKey
but all six called MethodGetValueOrDefault, so two of the three methods had zero
coverage while the suite reported 6/6 green. Each test now calls the method its
name claims, and the reversed Assert.AreEqual(actual, expected) arguments are
swapped to AreEqual(expected, actual) so a failure message tells the truth.
- Methods: dynamic / dynamic? return types replaced with T?; MethodGetValueOrDefault
takes string instead of string? (clears CS8620 and CS8603 on net10.0).
- New MethodGetValueOrDefaultWithFallback covering the two-argument
GetValueOrDefault(key, fallback) overload, with tests proving the fallback is
returned for a missing key and that a stored value equal to the fallback is
indistinguishable from a missing one.
- New test for FirstOrDefault on a dictionary: the default KeyValuePair is a struct,
not null.
- Packages: BenchmarkDotNet 0.15.8; Microsoft.NET.Test.Sdk 18.9.0, MSTest 4.3.3,
coverlet.collector 10.0.1. Removed the unused BenchmarkDotNet reference and the
System.Collections 4.3.0 compatibility shim from the app project.
Copy file name to clipboardExpand all lines: collections-dictionary/DefaultValueFromDictionaryInCSharp/DefaultValueFromDictionaryInCSharp.Benchmark/DefaultValueFromDictionaryInCSharp.Benchmark.csproj
Copy file name to clipboardExpand all lines: collections-dictionary/DefaultValueFromDictionaryInCSharp/DefaultValueFromDictionaryInCSharp/DefaultValueFromDictionaryInCSharp.csproj
Copy file name to clipboardExpand all lines: collections-dictionary/DefaultValueFromDictionaryInCSharp/DefaultValueFromDictionaryInCSharp/Methods/MethodContainsKey.cs
Copy file name to clipboardExpand all lines: collections-dictionary/DefaultValueFromDictionaryInCSharp/DefaultValueFromDictionaryInCSharp/Methods/MethodGetValueOrDefault.cs
Copy file name to clipboardExpand all lines: collections-dictionary/DefaultValueFromDictionaryInCSharp/DefaultValueFromDictionaryInCSharp/Methods/MethodTryGetValue.cs
0 commit comments