Beispiel #1
0
 private void RunToDictionaryOnAllCollectionTypes <T>(T[] items, Action <Dictionary <T, T> > validation)
 {
     validation(Enumerable.ToDictionary(items, key => key));
     validation(Enumerable.ToDictionary(items, key => key, value => value));
     validation(Enumerable.ToDictionary(new List <T>(items), key => key));
     validation(Enumerable.ToDictionary(new List <T>(items), key => key, value => value));
     validation(new TestEnumerable <T>(items).ToDictionary(key => key));
     validation(new TestEnumerable <T>(items).ToDictionary(key => key, value => value));
     validation(new TestReadOnlyCollection <T>(items).ToDictionary(key => key));
     validation(new TestReadOnlyCollection <T>(items).ToDictionary(key => key, value => value));
     validation(new TestCollection <T>(items).ToDictionary(key => key));
     validation(new TestCollection <T>(items).ToDictionary(key => key, value => value));
 }