public void Add_TwoEqualEntities_SizeEqualsOn(IHashSet <int> hasSet) { hasSet.Add(1); Assert.That(hasSet.Add(1), Is.EqualTo(false)); Assert.That(hasSet.Count, Is.EqualTo(1)); }
public void Containts_AddedFourItems_ForLastContaintsIsTrue(IHashSet <int> hasSet) { hasSet.Add(1); hasSet.Add(2); hasSet.Add(3); hasSet.Add(5); Assert.That(hasSet.Contains(3), Is.EqualTo(true)); Assert.That(hasSet.Contains(4), Is.EqualTo(false)); }
//O(1) time complexity; worst case O(n) //add an item to this hash table public void Add(TV value) { hashSet.Add(value); }
public void NegativeNumbersShouldNotCrash() => _set.Add(-100);
protected override void Put(IHashSet <string> collection, string value) { collection.Add(value); _last = value; }
//O(1) time complexity; worst case O(n) //add an item to this hash table public void Add(V value) { HashSet.Add(value); }