public void EnumerateBreakLoopDictionary() { long total = 0; DictionaryStructEnumerator <int, string, long> .AllocationFreeForEach( _Dictionary, ref total, AddToStateWithBreak); Assert.AreEqual(15, total); }
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); }