Beispiel #1
0
        public void ResetClears()
        {
            var objects = new object[245];

            for (var i = 0; i < 245; i++)
            {
                objects[i] = new object();
            }

            var indexes = new EntryIndex <object> [245];

            for (var i = 0; i < 245; i++)
            {
                var key   = objects[i];
                var value = new object();

                FixedSizeDictionary.AddOrReplace(key, value, out var index);
                indexes[i] = index;
            }

            FixedSizeDictionary.Reset();

            for (var i = 0; i < 245; i++)
            {
                Assert.False(FixedSizeDictionary.ContainsKey(objects[i]));
                Assert.False(FixedSizeDictionary.ContainsKey(indexes[i]));

                Assert.False(FixedSizeDictionary.TryGetValue(objects[i], out _));
                Assert.False(FixedSizeDictionary.TryGetValue(indexes[i], out _));
            }
        }