public void EditableLookupEnumerator() { var lookup = new EditableLookup <int, int>(); lookup.Add(1, 1); // multipliers.... lookup.Add(1, 2); lookup.Add(1, 3); lookup.Add(2, 4); lookup.Add(3, 5); int sum = lookup.Sum(x => x.Key * x.Sum()); Assert.AreEqual(6 + 8 + 15, sum); }
public void EditableLookupEnumerator() { var lookup = new EditableLookup<int, int>(); lookup.Add(1, 1); // multipliers.... lookup.Add(1, 2); lookup.Add(1, 3); lookup.Add(2, 4); lookup.Add(3, 5); int sum = lookup.Sum(x => x.Key * x.Sum()); Assert.AreEqual(6 + 8 + 15, sum); }