Пример #1
0
        public static void EmptyCollection_Negative()
        {
            Driver <RefX1 <int> >    IntDriver            = new Driver <RefX1 <int> >();
            RefX1IntGenerator        refX1IntGenerator    = new RefX1IntGenerator();
            Driver <ValX1 <string> > stringDriver         = new Driver <ValX1 <string> >();
            ValX1stringGenerator     valX1stringGenerator = new ValX1stringGenerator();

            IntDriver.EmptyCollection(refX1IntGenerator.NextValue, true);
            stringDriver.EmptyCollection(valX1stringGenerator.NextValue, true);
        }
Пример #2
0
        public static void AddClear_Negative()
        {
            Driver <RefX1 <int> > IntDriver         = new Driver <RefX1 <int> >();
            RefX1IntGenerator     refX1IntGenerator = new RefX1IntGenerator();

            RefX1 <int>[] intArrToRemove, intArrAfterRemove;
            RefX1 <int>[] intArr = PrepTests(refX1IntGenerator, 100, out intArrToRemove, out intArrAfterRemove);

            Driver <ValX1 <string> > stringDriver         = new Driver <ValX1 <string> >();
            ValX1stringGenerator     valX1stringGenerator = new ValX1stringGenerator();

            ValX1 <string>[] stringArrToRemove, stringArrAfterRemove;
            ValX1 <string>[] stringArr = PrepTests(valX1stringGenerator, 100, out stringArrToRemove, out stringArrAfterRemove);

            IntDriver.AddClear(intArr, refX1IntGenerator.NextValue, true);
            stringDriver.AddClear(stringArr, valX1stringGenerator.NextValue, true);
        }
Пример #3
0
        public static void NonEmptyCollectionAdd()
        {
            Driver <RefX1 <int> > IntDriver         = new Driver <RefX1 <int> >();
            RefX1IntGenerator     refX1IntGenerator = new RefX1IntGenerator();

            RefX1 <int>[] intArrToRemove, intArrAfterRemove;
            RefX1 <int>[] intArr = PrepTests(refX1IntGenerator, 100, out intArrToRemove, out intArrAfterRemove);

            Driver <ValX1 <string> > stringDriver         = new Driver <ValX1 <string> >();
            ValX1stringGenerator     valX1stringGenerator = new ValX1stringGenerator();

            ValX1 <string>[] stringArrToRemove, stringArrAfterRemove;
            ValX1 <string>[] stringArr = PrepTests(valX1stringGenerator, 100, out stringArrToRemove, out stringArrAfterRemove);

            IntDriver.NonEmptyCollectionAdd(intArr, refX1IntGenerator.NextValue, false);
            stringDriver.NonEmptyCollectionAdd(stringArr, valX1stringGenerator.NextValue, false);
        }
Пример #4
0
        private static ValX1 <string>[] PrepTests(ValX1stringGenerator generator, int count,
                                                  out ValX1 <string>[] toRemove, out ValX1 <string>[] afterRemove)
        {
            ValX1 <string>[] entireArray = new ValX1 <string> [count];
            toRemove    = new ValX1 <string> [count / 2];
            afterRemove = new ValX1 <string> [count / 2];
            for (int i = 0; i < 100; i++)
            {
                entireArray[i] = generator.NextValue();

                if ((i & 1) != 0)
                {
                    toRemove[i / 2] = entireArray[i];
                }
                else
                {
                    afterRemove[i / 2] = entireArray[i];
                }
            }

            return(entireArray);
        }