OpenTween.LRUCacheDictionaryTest.KeysTest C# (CSharp) Method

KeysTest() private method

private KeysTest ( ) : void
return void
        public void KeysTest()
        {
            var dict = new LRUCacheDictionary<string, string>
            {
                ["key1"] = "value1",
                ["key2"] = "value2",
                ["key3"] = "value3",
            };

            Assert.Equal(new[] { "key1", "key2", "key3" }, dict.Keys, collComparer);

            dict.Add("foo", "bar");
            Assert.Equal(new[] { "key1", "key2", "key3", "foo" }, dict.Keys, collComparer);

            dict.Remove("key2");
            Assert.Equal(new[] { "key1", "key3", "foo" }, dict.Keys, collComparer);

            dict.Clear();
            Assert.Empty(dict.Keys);
        }