예제 #1
0
        public void UnknownKeyReturnsDefaultInt()
        {
            var dict = new OrderedCaseInsensitiveStringKeyDictionary <int>
            {
                ["x"] = 17
            };

            Assert.AreEqual(17, dict["x"]);
            Assert.AreEqual(default, dict["y"]);
예제 #2
0
        public void KeyIsCaseInsensitive()
        {
            var dict = new OrderedCaseInsensitiveStringKeyDictionary <int>
            {
                ["x"] = 17
            };

            Assert.AreEqual(17, dict["x"]);
            Assert.AreEqual(17, dict["X"]);
        }
예제 #3
0
        public void ValueCanBeOverwritten()
        {
            var dict = new OrderedCaseInsensitiveStringKeyDictionary <int>
            {
                ["x"] = 17,
                ["X"] = 21
            };

            Assert.AreEqual(21, dict["x"]);
            Assert.AreEqual(21, dict["X"]);
        }