public void TestDictionaryTryGetValue()
{
AssertDictionaryException(delegate(IDictionary<string, string> dict)
{
string value;
// ReSharper disable AssignNullToNotNullAttribute
// This is sort of the point.
dict.TryGetValue(null, out value);
// ReSharper restore AssignNullToNotNullAttribute
}, new string[] { "null", "key" });
AssertDictionaryNoException(delegate(IDictionary<string, string> dict)
{
dict.Clear();
string value;
dict.TryGetValue("notthere", out value);
Assert.IsNull(value, "Value should be set to null now.");
});
}