Ejemplo n.º 1
0
        public void Init()
        {
            ISortedDictionary <string, string> dict = new TreeDictionary <string, string>(new SC());

            dict.Add("A", "1");
            dict.Add("C", "2");
            dict.Add("E", "3");
            this.dict = new GuardedSortedDictionary <string, string>(dict);
        }
Ejemplo n.º 2
0
        public void Init()
        {
            ISortedDictionary <string, string> dict = new TreeDictionary <string, string>(new SC())
            {
                { "A", "1" },
                { "C", "2" },
                { "E", "3" }
            };

            this.dict = new GuardedSortedDictionary <string, string>(dict);
        }
Ejemplo n.º 3
0
        public void Keys_returns_GuardedSorted()
        {
            var reverse = ComparerFactory <int> .CreateComparer((a, b) => a > b? -1 : 1);

            var source = new SortedArrayDictionary <int, string>(reverse)
            {
                [1] = "one",
                [2] = "two",
                [3] = "three"
            };

            var guarded = new GuardedSortedDictionary <int, string>(source);

            Assert.IsAssignableFrom <GuardedSorted <int> >(guarded.Keys);
        }
Ejemplo n.º 4
0
        public void Values_returns_Values()
        {
            var reverse = ComparerFactory <int> .CreateComparer((a, b) => a > b? -1 : 1);

            var source = new SortedArrayDictionary <int, string>(reverse)
            {
                [1] = "one",
                [2] = "two",
                [3] = "three"
            };

            var guarded = new GuardedSortedDictionary <int, string>(source);

            CollectionAssert.AreEquivalent(new[] { "one", "two", "three" }, guarded.Values);
        }
Ejemplo n.º 5
0
 public void Dispose()
 {
     dict = null;
 }