Esempio n. 1
0
        public int[] CheckAddExistingElementToSet(int[] array, int element)
        {
            var set = new GenericSet <int>(array);

            Assert.That(set.Add(element), Is.False);
            return(set.ToArray());
        }
Esempio n. 2
0
        public int[] CheckRemoveNonExistingElementFromSet(int[] array, int element)
        {
            var set = new GenericSet <int>(array);

            Assert.That(set.Remove(element), Is.False);
            return(set.ToArray());
        }
Esempio n. 3
0
        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()));
        }