Beispiel #1
0
        public void Test()
        {
            var container = new OrderedMultiDictionary <string, float>();

            container.Add("hoge", 42f);
            Assert.AreEqual(42f, container["hoge"][0]);

            Assert.AreEqual(0, container["fuga"].Count);

            container.Add("hoge", 97f);

            Assert.False(container.Remove("piyo"));
            Assert.True(container.Remove("hoge"));
        }
Beispiel #2
0
        public void GetRange(float begin, float end)
        {
            var container = new OrderedMultiDictionary <float, string>();

            container.Add(0f, "hoge");
            container.Add(0f, "fuga");
            container.Add(0f, "piyo");
            container.Add(-1f, "a");
            container.Add(1f, "b");

            var range = container.GetRange(begin, end).ToArray();

            Assert.AreEqual(new KeyValuePair <float, string>(0f, "hoge"), range[0]);
            Assert.AreEqual(new KeyValuePair <float, string>(0f, "fuga"), range[1]);
            Assert.AreEqual(new KeyValuePair <float, string>(0f, "piyo"), range[2]);
            Assert.AreEqual(new KeyValuePair <float, string>(1f, "b"), range[3]);
            Assert.AreEqual(4, range.Length);
        }