System.Linq.Tests.WhereTests.Where_IReadOnlyCollection_CurrentIsDefaultOfTAfterEnumeration C# (CSharp) Method

Where_IReadOnlyCollection_CurrentIsDefaultOfTAfterEnumeration() private method

        public void Where_IReadOnlyCollection_CurrentIsDefaultOfTAfterEnumeration()
        {
            IReadOnlyCollection<int> source = new ReadOnlyCollection<int>(new List<int>() { 1 });
            Func<int, bool> truePredicate = (value) => true;

            var enumerator = source.Where(truePredicate).GetEnumerator();
            while (enumerator.MoveNext()) ;

            Assert.Equal(default(int), enumerator.Current);
        }
WhereTests