コード例 #1
0
        public void OverloadsTest()
        {
            short x = 42;

            var derivedClass       = new DerivedClass2();
            var baseClass          = new BaseClass2();
            var derivedClassAsBase = derivedClass as BaseClass2;

            //Assert.IsTrue(derivedClass.Foo(x).StartsWith("??"));
            //Assert.IsTrue(baseClass.Foo(x).StartsWith("??"));
            //Assert.IsTrue(derivedClassAsBase.Foo(42).StartsWith("??"));
        }
コード例 #2
0
 private string Test(DerivedClass2 item) => "DerivedClass version";
コード例 #3
0
        public void GenericOverloadsTest()
        {
            var x = new DerivedClass2();

            GenericMethod <DerivedClass2, DerivedClass2>(x, x);
        }