public void Keys_1Dimension(JaggedDictionary<int, string> sut, JaggedIndex1<int>[] keys, string value) { foreach (var key in keys) sut[key] = value; var list = sut.Keys.ToList(); Assert.Equal(keys.Length, list.Count); foreach (var item in list) { Assert.True(keys.Cast<IJaggedIndex<int>>().Contains(item)); } }
public void Enumerate_1Dimension(JaggedDictionary<int, string> sut, JaggedIndex1<int>[] keys, string value) { foreach (var key in keys) sut[key] = value; var keyValuePairs = sut.ToList(); Assert.Equal(keys.Length, keyValuePairs.Count); foreach (var kvp in keyValuePairs) { Assert.True(keys.Cast<IJaggedIndex<int>>().Contains(kvp.Key)); Assert.Equal(value, kvp.Value); } }