public static IEnumerable <Group> Where(this GroupCollection collection, Func <Group, bool> predicate)
        {
            var data = new Group[collection.Count];

            collection.CopyTo(data, 0);
            return(data.Where(predicate));
        }
        public static Group FirstOrDefault(this GroupCollection collection, Func <Group, bool> predicate)
        {
            var data = new Group[collection.Count];

            collection.CopyTo(data, 0);
            return(data.FirstOrDefault(predicate));
        }
Esempio n. 3
0
        public void Deny_Unrestricted()
        {
            Assert.AreEqual(1, coll.Count, "Count");
            Assert.IsTrue(coll.IsReadOnly, "IsReadOnly");
            Assert.IsFalse(coll.IsSynchronized, "IsSynchronized");
            Assert.IsNotNull(coll.SyncRoot, "SyncRoot");
            Assert.IsNotNull(coll[0], "this[int]");

            Assert.IsNotNull(coll.GetEnumerator(), "GetEnumerator");
            Group[] groups = new Group[1];
            coll.CopyTo(groups, 0);
        }