Ejemplo n.º 1
0
    static int Main(string[] args)
    {
        ITest test     = new Level3();
        ITest gen_test = new GenericLevel4();

        int ret1 = test.Test;
        int ret2 = test.Test2;

        int gen_ret1 = gen_test.Test;
        int gen_ret2 = gen_test.Test2;

        if (ret1 != 21 || ret2 != 32)
        {
            Console.WriteLine("FAIL");
            Console.WriteLine("EXPECTED: '21' and '32' when invoking test.Test and test.Test2 on an instance of Level3");
            Console.WriteLine("ACTUAL: '" + ret1 + "' and '" + ret2 + "'");
            return(101);
        }

        if (gen_ret1 != 21 || gen_ret2 != 32)
        {
            Console.WriteLine("FAIL");
            Console.WriteLine("EXPECTED: '21' and '32' when invoking gen_test.Test and gen_test.Test2 on an instance of GenericLevel4");
            Console.WriteLine("ACTUAL: '" + gen_ret1 + "' and '" + gen_ret2 + "'");
            return(102);
        }

        Console.WriteLine("PASS");
        return(100);
    }
Ejemplo n.º 2
0
        public static void Entry()
        {
            ITest test     = new Level3();
            ITest gen_test = new GenericLevel4();

            int ret1 = test.Test;
            int ret2 = test.Test2;

            int gen_ret1 = gen_test.Test;
            int gen_ret2 = gen_test.Test2;
        }