Пример #1
0
        public void AsReadOnly()
        {
            string[] s_array = { "Eric", "Clapton", null, "The", "World" };
            int[]    i_array = { 1, 5, 6, 5, 19 };

            ReadWriteTestDictionary <string, int> dict1 = new ReadWriteTestDictionary <string, int>(s_array, i_array);
            IDictionary <string, int>             dict2 = dict1.AsReadOnly();

            InterfaceTests.TestReadOnlyDictionaryGeneric <string, int>(dict2, s_array, i_array, "foo", true, null, null, null);
        }
Пример #2
0
        public void ReadOnlyDictionary()
        {
            string[] s_array = { "Eric", "Clapton", "Rules", "The", "World" };
            int[]    i_array = { 1, 5, 6, 5, 19 };

            ReadOnlyTestDictionary <string, int> dict = new ReadOnlyTestDictionary <string, int>(s_array, i_array);

            InterfaceTests.TestReadOnlyDictionary <string, int>(dict, s_array, i_array, "foo", true, "ReadOnlyTestDictionary");
            InterfaceTests.TestReadOnlyDictionary <string, int>(dict, s_array, i_array, "foo", false, "ReadOnlyTestDictionary");
            InterfaceTests.TestReadOnlyDictionaryGeneric <string, int>(dict, s_array, i_array, "foo", true, "ReadOnlyTestDictionary", null, null);
            InterfaceTests.TestReadOnlyDictionaryGeneric <string, int>(dict, s_array, i_array, "foo", false, "ReadOnlyTestDictionary", null, null);
        }