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)); }
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()); }
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); }
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); }