Skip to content

Instantly share code, notes, and snippets.

@dha-lo-jd
Created March 20, 2015 06:18
Show Gist options
  • Save dha-lo-jd/f8ce78f58c7201e872bf to your computer and use it in GitHub Desktop.
Save dha-lo-jd/f8ce78f58c7201e872bf to your computer and use it in GitHub Desktop.
ウワーッ
Action<string> a = s => { };
Action<string> b = s => { };
var d = new Dictionary<Action<string>, string>();
d.Add(a, "a");
d.Add(b, "b");
Assert.IsTrue(a.Equals(a));
Assert.IsFalse(a.Equals(b));
Assert.AreEqual("a", d[a]);
Assert.AreEqual("b", d[b]);
try
{
Assert.AreEqual("a", d[s => { }]);
Assert.Fail();
}
catch (Exception)
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment