示例#1
0
        public void Clear0()
        {
            var a = new LruDictionary <int, string>(10);

            Assert.IsTrue(a.CurrentSize == 0);
            Assert.IsTrue(a.Count == 0);

            a.Clear();
            Assert.IsTrue(a.CurrentSize == 0);
            Assert.IsTrue(a.Count == 0);
        }
示例#2
0
        public void Clear2()
        {
            var a = new LruDictionary <int, string>(10);

            a.Add(1, "one", 3, onRemove: default);
            a.Add(2, "two", 4, onRemove: default);
            Assert.IsTrue(a.CurrentSize == 7);
            Assert.IsTrue(a.Count == 2);

            a.Clear();
            Assert.IsTrue(a.CurrentSize == 0);
            Assert.IsTrue(a.Count == 0);
        }