Exemple #1
0
    public static void RunTests()
    {
        Driver <RefX1 <int> > IntDriver = new Driver <RefX1 <int> >();

        RefX1 <int>[]     intArr            = new RefX1 <int> [100];
        RefX1 <int>[]     intArrToRemove    = new RefX1 <int> [50];
        RefX1 <int>[]     intArrAfterRemove = new RefX1 <int> [50];
        RefX1IntGenerator refX1IntGenerator = new RefX1IntGenerator();

        for (int i = 0; i < 100; i++)
        {
            intArr[i] = refX1IntGenerator.NextValue();

            if ((i & 1) != 0)
            {
                intArrToRemove[i / 2] = intArr[i];
            }
            else
            {
                intArrAfterRemove[i / 2] = intArr[i];
            }
        }

        IntDriver.CheckType();
        IntDriver.EmptyCollection(refX1IntGenerator.NextValue);
        IntDriver.NonEmptyCollectionIEnumerableCtor(intArr, refX1IntGenerator.NextValue);
        IntDriver.NonEmptyCollectionAdd(intArr, refX1IntGenerator.NextValue);
        IntDriver.AddRemoveSome(intArrAfterRemove, intArr, intArrToRemove, refX1IntGenerator.NextValue);
        IntDriver.AddRemoveAll(intArr, refX1IntGenerator.NextValue);
        IntDriver.AddClear(intArr, refX1IntGenerator.NextValue);


        Driver <ValX1 <String> > StringDriver = new Driver <ValX1 <String> >();

        ValX1 <String>[]     StringArr            = new ValX1 <String> [100];
        ValX1 <String>[]     StringArrToRemove    = new ValX1 <String> [50];
        ValX1 <String>[]     StringArrAfterRemove = new ValX1 <String> [50];
        ValX1StringGenerator valX1StringGenerator = new ValX1StringGenerator();

        for (int i = 0; i < 100; i++)
        {
            StringArr[i] = valX1StringGenerator.NextValue();

            if ((i & 1) != 0)
            {
                StringArrToRemove[i / 2] = StringArr[i];
            }
            else
            {
                StringArrAfterRemove[i / 2] = StringArr[i];
            }
        }

        StringDriver.CheckType();
        StringDriver.EmptyCollection(valX1StringGenerator.NextValue);
        StringDriver.NonEmptyCollectionIEnumerableCtor(StringArr, valX1StringGenerator.NextValue);
        StringDriver.NonEmptyCollectionAdd(StringArr, valX1StringGenerator.NextValue);
        StringDriver.AddRemoveSome(StringArrAfterRemove, StringArr, StringArrToRemove, valX1StringGenerator.NextValue);
        StringDriver.AddRemoveAll(StringArr, valX1StringGenerator.NextValue);
        StringDriver.AddClear(StringArr, valX1StringGenerator.NextValue);

        Assert.True(List_ListUtils.Test.result);
    }