override public object runOneIteration()
    {
        int number = random.Next(100);

        var obj;

        if (number == 0)
        {
            obj = new Derived0();
        }

        else if (number == 1)
        {
            obj = new Derived1();
        }

        else if (number == 2)
        {
            obj = new Derived2();
        }

        else if (number == 3)
        {
            obj = new Derived3();
        }

        else if (number == 4)
        {
            obj = new Derived4();
        }

        else if (number == 5)
        {
            obj = new Derived5();
        }

        else if (number == 6)
        {
            obj = new Derived6();
        }

        else if (number == 7)
        {
            obj = new Derived7();
        }

        else if (number == 8)
        {
            obj = new Derived8();
        }

        else if (number == 9)
        {
            obj = new Derived9();
        }

        else if (number == 10)
        {
            obj = new Derived10();
        }

        else if (number == 11)
        {
            obj = new Derived11();
        }

        else if (number == 12)
        {
            obj = new Derived12();
        }

        else if (number == 13)
        {
            obj = new Derived13();
        }

        else if (number == 14)
        {
            obj = new Derived14();
        }

        else if (number == 15)
        {
            obj = new Derived15();
        }

        else if (number == 16)
        {
            obj = new Derived16();
        }

        else if (number == 17)
        {
            obj = new Derived17();
        }

        else if (number == 18)
        {
            obj = new Derived18();
        }

        else if (number == 19)
        {
            obj = new Derived19();
        }

        else if (number == 20)
        {
            obj = new Derived20();
        }

        else if (number == 21)
        {
            obj = new Derived21();
        }

        else if (number == 22)
        {
            obj = new Derived22();
        }

        else if (number == 23)
        {
            obj = new Derived23();
        }

        else if (number == 24)
        {
            obj = new Derived24();
        }

        else if (number == 25)
        {
            obj = new Derived25();
        }

        else if (number == 26)
        {
            obj = new Derived26();
        }

        else if (number == 27)
        {
            obj = new Derived27();
        }

        else if (number == 28)
        {
            obj = new Derived28();
        }

        else if (number == 29)
        {
            obj = new Derived29();
        }

        else if (number == 30)
        {
            obj = new Derived30();
        }

        else if (number == 31)
        {
            obj = new Derived31();
        }

        else if (number == 32)
        {
            obj = new Derived32();
        }

        else if (number == 33)
        {
            obj = new Derived33();
        }

        else if (number == 34)
        {
            obj = new Derived34();
        }

        else if (number == 35)
        {
            obj = new Derived35();
        }

        else if (number == 36)
        {
            obj = new Derived36();
        }

        else if (number == 37)
        {
            obj = new Derived37();
        }

        else if (number == 38)
        {
            obj = new Derived38();
        }

        else if (number == 39)
        {
            obj = new Derived39();
        }

        else if (number == 40)
        {
            obj = new Derived40();
        }

        else if (number == 41)
        {
            obj = new Derived41();
        }

        else if (number == 42)
        {
            obj = new Derived42();
        }

        else if (number == 43)
        {
            obj = new Derived43();
        }

        else if (number == 44)
        {
            obj = new Derived44();
        }

        else if (number == 45)
        {
            obj = new Derived45();
        }

        else if (number == 46)
        {
            obj = new Derived46();
        }

        else if (number == 47)
        {
            obj = new Derived47();
        }

        else if (number == 48)
        {
            obj = new Derived48();
        }

        else if (number == 49)
        {
            obj = new Derived49();
        }

        else if (number == 50)
        {
            obj = new Derived50();
        }

        else if (number == 51)
        {
            obj = new Derived51();
        }

        else if (number == 52)
        {
            obj = new Derived52();
        }

        else if (number == 53)
        {
            obj = new Derived53();
        }

        else if (number == 54)
        {
            obj = new Derived54();
        }

        else if (number == 55)
        {
            obj = new Derived55();
        }

        else if (number == 56)
        {
            obj = new Derived56();
        }

        else if (number == 57)
        {
            obj = new Derived57();
        }

        else if (number == 58)
        {
            obj = new Derived58();
        }

        else if (number == 59)
        {
            obj = new Derived59();
        }

        else if (number == 60)
        {
            obj = new Derived60();
        }

        else if (number == 61)
        {
            obj = new Derived61();
        }

        else if (number == 62)
        {
            obj = new Derived62();
        }

        else if (number == 63)
        {
            obj = new Derived63();
        }

        else if (number == 64)
        {
            obj = new Derived64();
        }

        else if (number == 65)
        {
            obj = new Derived65();
        }

        else if (number == 66)
        {
            obj = new Derived66();
        }

        else if (number == 67)
        {
            obj = new Derived67();
        }

        else if (number == 68)
        {
            obj = new Derived68();
        }

        else if (number == 69)
        {
            obj = new Derived69();
        }

        else if (number == 70)
        {
            obj = new Derived70();
        }

        else if (number == 71)
        {
            obj = new Derived71();
        }

        else if (number == 72)
        {
            obj = new Derived72();
        }

        else if (number == 73)
        {
            obj = new Derived73();
        }

        else if (number == 74)
        {
            obj = new Derived74();
        }

        else if (number == 75)
        {
            obj = new Derived75();
        }

        else if (number == 76)
        {
            obj = new Derived76();
        }

        else if (number == 77)
        {
            obj = new Derived77();
        }

        else if (number == 78)
        {
            obj = new Derived78();
        }

        else if (number == 79)
        {
            obj = new Derived79();
        }

        else if (number == 80)
        {
            obj = new Derived80();
        }

        else if (number == 81)
        {
            obj = new Derived81();
        }

        else if (number == 82)
        {
            obj = new Derived82();
        }

        else if (number == 83)
        {
            obj = new Derived83();
        }

        else if (number == 84)
        {
            obj = new Derived84();
        }

        else if (number == 85)
        {
            obj = new Derived85();
        }

        else if (number == 86)
        {
            obj = new Derived86();
        }

        else if (number == 87)
        {
            obj = new Derived87();
        }

        else if (number == 88)
        {
            obj = new Derived88();
        }

        else if (number == 89)
        {
            obj = new Derived89();
        }

        else if (number == 90)
        {
            obj = new Derived90();
        }

        else if (number == 91)
        {
            obj = new Derived91();
        }

        else if (number == 92)
        {
            obj = new Derived92();
        }

        else if (number == 93)
        {
            obj = new Derived93();
        }

        else if (number == 94)
        {
            obj = new Derived94();
        }

        else if (number == 95)
        {
            obj = new Derived95();
        }

        else if (number == 96)
        {
            obj = new Derived96();
        }

        else if (number == 97)
        {
            obj = new Derived97();
        }

        else if (number == 98)
        {
            obj = new Derived98();
        }

        else
        {
            obj = new Derived99();
        }

        return(this.runWithNoInference(obj));
    }
Esempio n. 2
0
        public static void TestExternalOverriding()
        {
            var d1 = new Derived1();

            Assert.Null(d1["Foo$1"], "Derived1 in group 1 should not have Foo$1");
            Assert.Null(d1["Foo$2"], "Derived1 in group 1 should not have Foo$2");
            Assert.AreEqual(2, d1["Foo"].As <Func <int> >()(), "Derived1 in group 1 [Foo] should return 2");
            Assert.AreEqual(2, d1.Foo(), "Derived1 in group 1 Foo should return 2");
            Assert.AreEqual(2, d1.Foo(""), "Derived1 in group 1 Foo() should return 2");
            CheckBridge2874Base(d1, "2", 2);

            var d11 = new Derived11();

            Assert.Null(d11["Foo$1"], "Derived11 in group 3 should not have Foo$1");
            Assert.Null(d11["Foo$2"], "Derived11 in group 3 should not have Foo$2");
            Assert.AreEqual(11, d11["Foo"].As <Func <int> >()(), "Derived11 in group 3 [Foo] should return 11");
            Assert.AreEqual(11, d11.Foo(), "Derived11 in group 3 Foo should return 11");
            Assert.AreEqual(11, d11.Foo(""), "Derived11 in group 3 Foo() should return 11");
            CheckBridge2874Base(d11, "4", 11);

            var d12 = new Derived12();

            Assert.Null(d12["Foo$1"], "Derived12 in group 5 should not have Foo$1");
            Assert.Null(d12["Foo$2"], "Derived12 in group 5 should not have Foo$2");
            Assert.AreEqual(1, d12["Foo"].As <Func <int> >()(), "Derived12 in group 5 [Foo] should return 1");
            Assert.AreEqual(1, d12.Foo(), "Derived12 in group 5 Foo should return 1");
            Assert.AreEqual(1, d12.Foo(""), "Derived12 in group 5 Foo() should return 1");
            CheckBridge2874Base(d12, "6", 1);

            var d21 = new Derived21();

            Assert.Null(d21["Foo$1"], "Derived21 in group 7 should not have Foo$1");
            Assert.Null(d21["Foo$2"], "Derived21 in group 7 should not have Foo$2");
            Assert.AreEqual(21, d21["Foo"].As <Func <int> >()(), "Derived21 in group 7 [Foo] should return 21");
            Assert.AreEqual(21, d21.Foo(), "Derived21 in group 7 Foo should return 21");
            Assert.AreEqual(21, d21.Foo(""), "Derived21 in group 7 Foo() should return 21");
            CheckBridge2874Base(d21, "8", 21);

            var d22 = new Derived22();

            Assert.NotNull(d22["Foo$1"], "Derived22 in group 9 should have Foo$1");
            Assert.Null(d22["Foo$2"], "Derived22 in group 9 should not have Foo$2");
            Assert.AreEqual(22, d22["Foo$1"].As <Func <int> >()(), "Derived22 in group 9 [Foo$1] should return 22");
            Assert.AreEqual(22, d22.Foo(), "Derived22 in group 9 Foo should return 22");
            Assert.AreEqual(2, d22.Foo(""), "Derived22 in group 9 Foo() should return 2");
            CheckBridge2874Base(d22, "10", 2, false);

            var d23 = new Derived23();

            Assert.Null(d23["Foo$1"], "Derived23 in group 11 should not have Foo$1");
            Assert.Null(d23["Foo$2"], "Derived23 in group 11 should not have Foo$2");
            Assert.AreEqual(23, d23["Foo"].As <Func <int> >()(), "Derived23 in group 11 [Foo] should return 23");
            Assert.AreEqual(23, d23.Foo(), "Derived23 in group 11 Foo should return 23");
            Assert.AreEqual(23, d23.Foo(""), "Derived23 in group 11 Foo() should return 23");
            CheckBridge2874Base(d23, "12", 23);

            var d24 = new Derived24();

            Assert.NotNull(d24["Foo$1"], "Derived24 in group 13 should not have Foo$1");
            Assert.Null(d24["Foo$2"], "Derived24 in group 13 should not have Foo$2");
            Assert.AreEqual(24, d24["Foo$1"].As <Func <int> >()(), "Derived24 in group 13 [Foo] should return 24");
            Assert.AreEqual(2, d24.Foo(), "Derived24 in group 13 Foo should return 2");
            Assert.AreEqual(24, d24.Foo(""), "Derived24 in group 13 Foo() should return 24");
            CheckBridge2874Base(d24, "14", 2, false);

            var d25 = new Derived25();

            Assert.Null(d25["Foo$1"], "Derived25 in group 15 should not have Foo$1");
            Assert.Null(d25["Foo$2"], "Derived25 in group 15 should not have Foo$2");
            Assert.AreEqual(2, d25["Foo"].As <Func <int> >()(), "Derived25 in group 15 [Foo] should return 2");
            Assert.AreEqual(2, d25.Foo(), "Derived25 in group 15 Foo should return 2");
            Assert.AreEqual(2, d25.Foo(""), "Derived25 in group 15 Foo() should return 2");
            CheckBridge2874Base(d25, "16", 2);
        }