public int[] CheckAddExistingElementToSet(int[] array, int element) { var set = new GenericSet <int>(array); Assert.That(set.Add(element), Is.False); return(set.ToArray()); }
public int[] CheckRemoveNonExistingElementFromSet(int[] array, int element) { var set = new GenericSet <int>(array); Assert.That(set.Remove(element), Is.False); return(set.ToArray()); }
public void CheckSetEnumerator(int[] array) { var set = new GenericSet <int>(array); var list = new List <int>(); foreach (var item in set) { list.Add(item); } Assert.That(set.ToArray(), Is.EqualTo(list.ToArray())); }