Пример #1
0
        public static void TestI10_2()
        {
            var c21 = new C21();
            C20 c20 = c21;
            I10 i10 = c21;

            c21.Foo();
            Assert.AreEqual("C21", c21.log);
            c21.log = null;

            c20.Foo();
            Assert.AreEqual("C21", c21.log);
            c21.log = null;

            i10.Foo();
            Assert.AreEqual("C21", c21.log);

            var c24 = new C24();

            i10 = c24;

            i10.Foo();
            Assert.AreEqual("C22", c24.log);
        }
Пример #2
0
        public static void TestI10_1()
        {
            var c19 = new C19();
            C18 c18 = c19;
            I10 i10 = c19;

            c19.Foo();
            Assert.AreEqual("C19", c19.log);
            c19.log = null;

            c18.Foo();
            Assert.AreEqual("C18", c19.log);
            c19.log = null;

            i10.Foo();
            Assert.AreEqual("C19", c19.log);
        }
Пример #3
0
        public static void TestI10()
        {
            var c17 = new C17();
            C16 c16 = c17;
            I10 i10 = c17;

            c17.Foo();
            Assert.AreEqual("C17", c17.log);
            c17.log = null;

            c16.Foo();
            Assert.AreEqual("C16", c17.log);
            c17.log = null;

            i10.Foo();
            Assert.AreEqual("C16", c17.log);
        }