Esempio n. 1
0
        public void TestGetFinalMapping()
        {
            var mapping1 = new SortedDictionary <int, int>();

            mapping1[1] = 1;
            mapping1[2] = 2;
            mapping1[3] = 3;
            var mapping2 = new SortedDictionary <int, int>();

            mapping2[1] = 2;
            mapping2[2] = 1;
            mapping2[3] = 3;

            var mappings = new List <IReadOnlyDictionary <int, int> >(2);

            mappings.Add(mapping1);
            mappings.Add(mapping2);
            FinalMappings instance = new FinalMappings();

            instance.Set(mappings);

            var expResult = mappings;
            var result    = instance.GetFinalMapping();

            Assert.IsTrue(Compares.AreEqual(expResult, result));
        }
Esempio n. 2
0
        public void TestGetIterator()
        {
            var mapping1 = new SortedDictionary <int, int>();

            mapping1[1] = 1;
            mapping1[2] = 2;
            mapping1[3] = 3;
            var mapping2 = new SortedDictionary <int, int>();

            mapping2[1] = 2;
            mapping2[2] = 1;
            mapping2[3] = 3;

            var mappings = new List <IReadOnlyDictionary <int, int> >(2);

            mappings.Add(mapping1);
            mappings.Add(mapping2);
            FinalMappings instance = new FinalMappings();

            instance.Set(mappings);

            Assert.AreEqual(true, instance.Any());
        }
Esempio n. 3
0
        public void TestGetSize()
        {
            var mapping1 = new SortedDictionary <int, int>
            {
                [1] = 1,
                [2] = 2,
                [3] = 3
            };
            var mapping2 = new SortedDictionary <int, int>
            {
                [1] = 2,
                [2] = 1,
                [3] = 3
            };

            var mappings = new List <IReadOnlyDictionary <int, int> >(2);

            mappings.Add(mapping1);
            mappings.Add(mapping2);
            FinalMappings instance = new FinalMappings();

            instance.Set(mappings);
            Assert.AreEqual(2, instance.Count);
        }
Esempio n. 4
0
        public void TestClear()
        {
            var mapping1 = new SortedDictionary <int, int>();

            mapping1[1] = 1;
            mapping1[2] = 2;
            mapping1[3] = 3;
            var mapping2 = new SortedDictionary <int, int>();

            mapping2[1] = 2;
            mapping2[2] = 1;
            mapping2[3] = 3;

            var mappings = new List <IReadOnlyDictionary <int, int> >(2);

            mappings.Add(mapping1);
            mappings.Add(mapping2);
            FinalMappings instance = new FinalMappings();

            instance.Set(mappings);
            Assert.AreEqual(2, instance.Count);
            instance.Clear();
            Assert.AreEqual(0, instance.Count);
        }