//[TestMethod] public bool ShouldCallFooWithReturnTypeGuid() { var actual = MethodOverloading.Foo(10D); return(actual is Guid); //Assert.IsInstanceOfType(actual, typeof(Guid)); }
//[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)); }