Example #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));
        }
Example #2
0
        public void TestAdd()
        {
            var mapping = new SortedDictionary <int, int>();

            mapping[1] = 1;
            mapping[2] = 2;
            mapping[3] = 3;

            FinalMappings instance = new FinalMappings();

            instance.Add(mapping);
            Assert.AreEqual(1, instance.Count);
        }
Example #3
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());
        }
Example #4
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);
        }
Example #5
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);
        }
Example #6
0
        public void TestInstance()
        {
            FinalMappings result = FinalMappings.Instance;

            Assert.IsNotNull(result);
        }