Ejemplo n.º 1
0
        public void EmptyCollection(Func <T> generateItem, bool testExceptions)
        {
            List <T> list = new List <T>();

            if (testExceptions)
            {
                VerifyReadOnlyIList <T> .VerifyExceptions(new ReadOnlyCollection <T>(list), new T[0], generateItem);
            }
            else
            {
                VerifyReadOnlyIList <T> .Verify(new ReadOnlyCollection <T>(list), new T[0], generateItem);
            }
        }
Ejemplo n.º 2
0
        public void NonEmptyCollectionIEnumerableCtor(T[] items, Func <T> generateItem, bool testExceptions)
        {
            List <T> list = new List <T>(new TestCollection <T>(items));

            if (testExceptions)
            {
                VerifyReadOnlyIList <T> .VerifyExceptions(new ReadOnlyCollection <T>(list), items, generateItem);
            }
            else
            {
                VerifyReadOnlyIList <T> .Verify(new ReadOnlyCollection <T>(list), items, generateItem);
            }
            //, "Err_884964ahbz NON Empty Collection using the IEnumerable constructor to populate the list Test FAILED");
        }
Ejemplo n.º 3
0
        public void NonEmptyCollectionAdd(T[] items, Func <T> generateItem, bool testExceptions)
        {
            List <T> list = new List <T>();

            for (int i = 0; i < items.Length; ++i)
            {
                list.Add(items[i]);
            }

            if (testExceptions)
            {
                VerifyReadOnlyIList <T> .VerifyExceptions(new ReadOnlyCollection <T>(list), items, generateItem);
            }
            else
            {
                VerifyReadOnlyIList <T> .Verify(new ReadOnlyCollection <T>(list), items, generateItem);
            }
        }
Ejemplo n.º 4
0
        public void AddRemoveAll(T[] items, Func <T> generateItem, bool testExceptions)
        {
            List <T> list = new List <T>();

            for (int i = 0; i < items.Length; ++i)
            {
                list.Add(items[i]);
            }

            for (int i = 0; i < items.Length; ++i)
            {
                list.RemoveAt(0);
            }
            if (testExceptions)
            {
                VerifyReadOnlyIList <T> .VerifyExceptions(new ReadOnlyCollection <T>(list), new T[0], generateItem);
            }
            else
            {
                VerifyReadOnlyIList <T> .Verify(new ReadOnlyCollection <T>(list), new T[0], generateItem);
            }
        }
Ejemplo n.º 5
0
        public void AddRemoveSome(T[] items, T[] itemsToAdd, T[] itemsToRemove, Func <T> generateItem, bool testExceptions)
        {
            List <T> list = new List <T>();

            for (int i = 0; i < itemsToAdd.Length; ++i)
            {
                list.Add(itemsToAdd[i]);
            }

            for (int i = 0; i < itemsToRemove.Length; ++i)
            {
                list.Remove(itemsToRemove[i]);
            }

            if (testExceptions)
            {
                VerifyReadOnlyIList <T> .VerifyExceptions(new ReadOnlyCollection <T>(list), items, generateItem);
            }
            else
            {
                VerifyReadOnlyIList <T> .Verify(new ReadOnlyCollection <T>(list), items, generateItem);
            }
        }