示例#1
0
        public void ConvertAllReturnCorrectValue()
        {
            ArraySet <int> arrSet = new ArraySet <int>();

            arrSet.Add(10);

            Assert.IsInstanceOfType(SetUtils.ConvertAll <int, MySet.HashSet <int> >(arrSet), typeof(MySet.HashSet <int>));
            Assert.IsInstanceOfType(SetUtils.ConvertAll <int, ArraySet <int> >(arrSet), typeof(ArraySet <int>));
            Assert.IsInstanceOfType(SetUtils.ConvertAll <int, LinkedSet <int> >(arrSet), typeof(LinkedSet <int>));
        }
示例#2
0
        public void ConvertAllReturnCorrectNumberOfElements()
        {
            ArraySet <int> arrSet        = new ArraySet <int>();
            int            numOfElements = 50;

            for (int i = 0; i < numOfElements; i++)
            {
                arrSet.Add(i);
            }

            Assert.AreEqual(numOfElements, SetUtils.ConvertAll <int, MySet.HashSet <int> >(arrSet).Count);
            Assert.AreEqual(numOfElements, SetUtils.ConvertAll <int, ArraySet <int> >(arrSet).Count);
            Assert.AreEqual(numOfElements, SetUtils.ConvertAll <int, LinkedSet <int> >(arrSet).Count);
        }