コード例 #1
0
        public static void VirtualFunc(out int r1, out int r2)
        {
            BaseClass o1 = new BaseClass();
            BaseClass o2 = new DrivenClass();

            r1 = o1.Foo();
            r2 = o2.Foo();
        }
コード例 #2
0
        public void VirtualFunc()
        {
            int r1, r2;

            Redirect.BaseTest.VirtualFunc(out r1, out r2);
            Assert.AreEqual(0, r1);
            Assert.AreEqual(1, r2);
            Redirect.BaseClass o1 = new Redirect.BaseClass();
            Redirect.BaseClass o2 = new Redirect.DrivenClass();
            Assert.AreEqual(0, o1.Foo());
            Assert.AreEqual(1, o2.Foo());
        }