Esempio n. 1
0
        public void TestRemoveWhere()
        {
            var set = new TreeSet <int>(4, Enumerable.Range(0, 10), comparer: null);

            Assert.Throws <ArgumentNullException>(() => set.RemoveWhere(null));

            Assert.Equal(5, set.RemoveWhere(i => (i % 2) == 0));
            Assert.Equal(new[] { 1, 3, 5, 7, 9 }, set);
            Assert.Equal(0, set.RemoveWhere(i => i < 0));
            Assert.Equal(5, set.Count);
        }