public void RemoveNonExisting() { 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.IsFalse(lookup.Remove("D")); Assert.AreEqual(3, lookup.Count); Assert.IsFalse(lookup.Remove("F", "asdf")); Assert.AreEqual(3, lookup.Count); lookup.Remove(null); Assert.IsFalse(lookup.Remove(null)); Assert.AreEqual(2, lookup.Count); }
public void CountValueType() { var lookup = new MutableLookup <int, int>(); Assert.AreEqual(0, lookup.Count); lookup.Add(1, 10); Assert.AreEqual(1, lookup.Count); lookup.Add(2, 20); Assert.AreEqual(2, lookup.Count); lookup.Add(2, 21); Assert.AreEqual(2, lookup.Count); lookup.Remove(1, 10); Assert.AreEqual(1, lookup.Count); }
public void CountRefType() { var lookup = new MutableLookup <string, string>(); Assert.AreEqual(0, lookup.Count); lookup.Add(null, "blah"); Assert.AreEqual(1, lookup.Count); lookup.Add("F", "Foo"); Assert.AreEqual(2, lookup.Count); lookup.Add("F", "Foobar"); Assert.AreEqual(2, lookup.Count); lookup.Remove(null, "blah"); Assert.AreEqual(1, lookup.Count); }
public void RemoveNonExisting() { 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.IsFalse (lookup.Remove ("D")); Assert.AreEqual(3, lookup.Count); Assert.IsFalse (lookup.Remove ("F", "asdf")); Assert.AreEqual(3, lookup.Count); lookup.Remove (null); Assert.IsFalse (lookup.Remove (null)); Assert.AreEqual (2, lookup.Count); }
public void CountValueType() { var lookup = new MutableLookup<int, int>(); Assert.AreEqual (0, lookup.Count); lookup.Add (1, 10); Assert.AreEqual (1, lookup.Count); lookup.Add (2, 20); Assert.AreEqual (2, lookup.Count); lookup.Add (2, 21); Assert.AreEqual (2, lookup.Count); lookup.Remove (1, 10); Assert.AreEqual(1, lookup.Count); }
public void CountRefType() { var lookup = new MutableLookup<string, string>(); Assert.AreEqual (0, lookup.Count); lookup.Add (null, "blah"); Assert.AreEqual (1, lookup.Count); lookup.Add ("F", "Foo"); Assert.AreEqual (2, lookup.Count); lookup.Add ("F", "Foobar"); Assert.AreEqual (2, lookup.Count); lookup.Remove (null, "blah"); Assert.AreEqual (1, lookup.Count); }