2010-04-02 Jb Evain <jbevain@novell.com>
authorJb Evain <jbevain@gmail.com>
Fri, 2 Apr 2010 12:05:37 +0000 (12:05 -0000)
committerJb Evain <jbevain@gmail.com>
Fri, 2 Apr 2010 12:05:37 +0000 (12:05 -0000)
* SortedSetTest.cs: add test for RemoveWhere.

svn path=/trunk/mcs/; revision=154710

mcs/class/System/Test/System.Collections.Generic/ChangeLog
mcs/class/System/Test/System.Collections.Generic/SortedSetTest.cs

index d5daccea9a7ebc8214f919c98acf5aad4dbc7576..18d73ccab026d3bae7b9ba87d14986e7d38e6fa8 100644 (file)
@@ -1,3 +1,7 @@
+2010-04-02  Jb Evain  <jbevain@novell.com>
+
+       * SortedSetTest.cs: add test for RemoveWhere.
+
 2010-04-02  Jb Evain  <jbevain@novell.com>
 
        * SortedSetTest.cs: add test for Reverse.
index a4b4c523732898d692afdf883db58106c40dda19..7d96d337acc1b4276254d3e15dfec386a91a690e 100644 (file)
 // distribute, sublicense, and/or sell copies of the Software, and to
 // permit persons to whom the Software is furnished to do so, subject to
 // the following conditions:
-// 
+//
 // The above copyright notice and this permission notice shall be
 // included in all copies or substantial portions of the Software.
-// 
+//
 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -119,6 +119,16 @@ namespace MonoTests.System.Collections.Generic
                        var reversed = set.Reverse ();
                        Assert.IsTrue (reversed.SequenceEqual (new [] { 6, 5, 4, 3, 2, 1 }));
                }
+
+               [Test]
+               public void RemoveWhere ()
+               {
+                       var set = new SortedSet<int> { 1, 2, 3, 4, 5, 6 };
+                       Assert.AreEqual (3, set.RemoveWhere (i => i % 2 == 0));
+                       Assert.AreEqual (3, set.Count);
+                       Assert.IsTrue (set.SequenceEqual (new [] { 1, 3, 5 }));
+
+               }
        }
 }