Beispiel #1
0
        public void EnumerateBreakLoopList()
        {
            long total = 0;

            ListStructEnumerator <int, long> .AllocationFreeForEach(
                _List,
                ref total,
                AddToStateWithBreak);

            Assert.AreEqual(15, total);
        }
Beispiel #2
0
        public void EnumerateDisposableList()
        {
            CustomList <int> list = new CustomList <int>(_List);

            long total = 0;

            ListStructEnumerator <int, long> .AllocationFreeForEach(
                list,
                ref total,
                AddToState);

            Assert.AreEqual(45, total);
            Assert.IsTrue(list.IsDisposed);
        }