public void Errors_Dictionary() { var dict = new System.Collections.Generic.Dictionary <int, int> { [1] = 2, [3] = 4 }; var sortedDict = new System.Collections.Generic.SortedDictionary <int, int> { [1] = 2, [3] = 4 }; try { dict.All(null); Assert.Fail(); }catch (ArgumentException exc) { Assert.AreEqual("predicate", exc.ParamName); } try { sortedDict.All(null); Assert.Fail(); } catch (ArgumentException exc) { Assert.AreEqual("predicate", exc.ParamName); } }
public void Chaining_Dictionary() { var dict = new System.Collections.Generic.Dictionary <int, int> { [1] = 2, [3] = 4 }; var sortedDict = new System.Collections.Generic.SortedDictionary <int, int> { [1] = 2, [3] = 4 }; Assert.IsTrue(dict.All(kv => kv.Key < 5)); Assert.IsTrue(sortedDict.All(kv => kv.Key < 5)); }