예제 #1
0
        //[TestMethod]
        public bool ShouldCallFooWithReturnTypeGuid()
        {
            var actual = MethodOverloading.Foo(10D);

            return(actual is Guid);
            //Assert.IsInstanceOfType(actual, typeof(Guid));
        }
예제 #2
0
        //[TestMethod]
        // This shows that the compiler will choose the best argument conversion since return type of a method
        // is not considered to be part of a method's signature.
        //
        // Note: that compiler chooses an overload before it checks whether return type will cause an error
        //
        public bool ShouldCallFooWithReturnTypeString()
        {
            var actual = MethodOverloading.Foo(10);

            return(actual is string);
            //Assert.IsInstanceOfType(actual, typeof(string));
        }