Exemplo n.º 1
0
        public void EnumerateBreakLoopDictionary()
        {
            long total = 0;

            DictionaryStructEnumerator <int, string, long> .AllocationFreeForEach(
                _Dictionary,
                ref total,
                AddToStateWithBreak);

            Assert.AreEqual(15, total);
        }
Exemplo n.º 2
0
        public void EnumerateDisposableDictionary()
        {
            CustomDictionary <int, string> Dictionary = new CustomDictionary <int, string>(_Dictionary);

            long total = 0;

            DictionaryStructEnumerator <int, string, long> .AllocationFreeForEach(
                Dictionary,
                ref total,
                AddToState);

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