* HashSetTest.cs: add test for #520760, ICollection<T>.Add
should not throw on duplicates.
svn path=/trunk/mcs/; revision=137652
+2009-07-09 Jb Evain <jbevain@novell.com>
+
+ * HashSetTest.cs: add test for #520760, ICollection<T>.Add
+ should not throw on duplicates.
+
2008-12-17 Jb Evain <jbevain@novell.com>
* HashSetTest.cs: add test for CopyTo.
Assert.AreEqual (42, dest [6]);
}
+ [Test]
+ public void TestICollection ()
+ {
+ var set = new HashSet<int> () as ICollection<int>;
+ set.Add (42);
+ set.Add (42);
+
+ Assert.AreEqual (2, set.Count);
+ }
+
static void AssertContainsOnly<T> (IEnumerable<T> result, IEnumerable<T> data)
{
Assert.AreEqual (result.Count (), data.Count ());