Skip to content

Commit

Permalink
Permit DictionaryContainsKeyValuePairConstraint to take in a null val…
Browse files Browse the repository at this point in the history
…ue, matching the nullability of DictionaryEntry.
  • Loading branch information
Andrew McClement committed Apr 12, 2024
1 parent 612dd8c commit 1b11929
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public DictionaryContainsKeyConstraint(object expected)
/// Returns a new DictionaryContainsKeyValuePairConstraint checking for the
/// presence of a particular key-value-pair in the dictionary.
/// </summary>
public DictionaryContainsKeyValuePairConstraint WithValue(object expectedValue)
public DictionaryContainsKeyValuePairConstraint WithValue(object? expectedValue)
{
return (DictionaryContainsKeyValuePairConstraint)Instead.Append(new DictionaryContainsKeyValuePairConstraint(Expected, expectedValue));
return Instead.Append(new DictionaryContainsKeyValuePairConstraint(Expected, expectedValue));
}

private bool Matches(object? actual)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public sealed class DictionaryContainsKeyValuePairConstraint : CollectionItemsEq
/// <summary>
/// Construct a DictionaryContainsKeyValuePairConstraint
/// </summary>
public DictionaryContainsKeyValuePairConstraint(object key, object value)
public DictionaryContainsKeyValuePairConstraint(object key, object? value)
{
_expected = new DictionaryEntry(key, value);
}
Expand Down

0 comments on commit 1b11929

Please sign in to comment.