-
-
Notifications
You must be signed in to change notification settings - Fork 540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added capability to assert that a generic dictionary with string key and custom equality comparer contains key. #61
Conversation
…and custom equality comparer contains key. IDictionary<string, string> dictionary = new ConcurrentDictionary<string, string>(StringComparer.OrdinalIgnoreCase); dictionary.Add("name", "foo"); //The following 2 lines assert the same and should both pass dictionary.ContainsKey("NaMe").Should().BeTrue(); //passes dictionary.Should().ContainKey("NaMe"); //failed before The fix assures that the second line passes also.
…and custom equality comparer contains key. IDictionary<string, string> dictionary = new ConcurrentDictionary<string, string>(StringComparer.OrdinalIgnoreCase); dictionary.Add("name", "foo"); //The following 2 lines assert the same and should both pass dictionary.ContainsKey("NaMe").Should().BeTrue(); //passes dictionary.Should().ContainKey("NaMe"); //failed before The fix assures that the second line passes also.
Great work! Can you please use the When_should() naming convention for the spec itself and the arrange-act-assert structure within the spec? |
Thanks!
|
Does this make sense for test method name? *a bit long though :) |
The spec is part of the dictionary specs, so why would you repeat the word dictionary at all?
|
…t-assert template.
Added capability to assert that a generic dictionary with string key and custom equality comparer contains key.
IDictionary<string, string> dictionary = new
ConcurrentDictionary<string, string>(StringComparer.OrdinalIgnoreCase);
dictionary.Add("name", "foo");
//The following 2 lines assert the same and should both pass
dictionary.ContainsKey("NaMe").Should().BeTrue(); //passes
dictionary.Should().ContainKey("NaMe"); //failed before
The fix assures that the second line passes also.