public void Enumerator() { List <int> ints = new List <int> { 10, 20, 21, 30 }; var lookup = new MutableLookup <int, int>(ints.ToLookup(i => Int32.Parse(i.ToString()[0].ToString()))); Assert.AreEqual(3, lookup.Count()); Assert.IsTrue(lookup.Any(g => g.Key == 1)); Assert.IsTrue(lookup.Any(g => g.Key == 2)); Assert.IsTrue(lookup.Any(g => g.Key == 3)); }
public void EnumeratorNull() { var lookup = new MutableLookup <string, string>(); lookup.Add(null, "blah"); lookup.Add(null, "monkeys"); lookup.Add("F", "Foo"); lookup.Add("F", "Foobar"); lookup.Add("B", "Bar"); Assert.AreEqual(3, lookup.Count()); Assert.IsTrue(lookup.Any(g => g.Key == null)); Assert.IsTrue(lookup.Any(g => g.Key == "F")); Assert.IsTrue(lookup.Any(g => g.Key == "B")); }
public void Enumerator() { List<int> ints = new List<int> { 10, 20, 21, 30 }; var lookup = new MutableLookup<int, int>(ints.ToLookup(i => Int32.Parse(i.ToString()[0].ToString()))); Assert.AreEqual (3, lookup.Count()); Assert.IsTrue (lookup.Any (g => g.Key == 1)); Assert.IsTrue (lookup.Any (g => g.Key == 2)); Assert.IsTrue (lookup.Any (g => g.Key == 3)); }
public void EnumeratorNull() { var lookup = new MutableLookup<string, string>(); lookup.Add (null, "blah"); lookup.Add (null, "monkeys"); lookup.Add ("F", "Foo"); lookup.Add ("F", "Foobar"); lookup.Add ("B", "Bar"); Assert.AreEqual (3, lookup.Count()); Assert.IsTrue (lookup.Any (g => g.Key == null)); Assert.IsTrue (lookup.Any (g => g.Key == "F")); Assert.IsTrue (lookup.Any (g => g.Key == "B")); }