From: Choy R. <ch...@us...> - 2005-05-11 04:08:40
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22636/DotNetMock.Tests/Dynamic Modified Files: MethodCallTests.cs Log Message: BUG [ 1194538 ] MethodCall::MethodName property has "somewhat-invalid" logic * needed to pass through the SpecialName attribute to the created mock method on the proxy type. * added check for IsSpecialName in handling of property access method calls. Index: MethodCallTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic/MethodCallTests.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MethodCallTests.cs 8 Apr 2005 01:21:50 -0000 1.4 --- MethodCallTests.cs 11 May 2005 04:08:31 -0000 1.5 *************** *** 28,31 **** --- 28,34 ---- void Method5(ToStringThrows x); + + int get_method6(); + void set_method6(); } interface IMethodsA *************** *** 53,62 **** --- 56,78 ---- static readonly MethodInfo property0_set = typeof(IMethods).GetMethod("set_Property0"); static readonly MethodInfo method5 = typeof(IMethods).GetMethod("Method5"); + static readonly MethodInfo get_method6 = typeof(IMethods).GetMethod("get_method6"); + static readonly MethodInfo set_method6 = typeof(IMethods).GetMethod("set_method6"); + [Test] public void MethodNameWorksForMethodsWithNamesLikePropertyAccessors() + { + MethodCall mc = new MethodCall(get_method6); + Assert.IsFalse(mc.IsPropertyAccess); + Assert.AreEqual("get_method6", mc.MethodName); + mc = new MethodCall(set_method6); + Assert.IsFalse(mc.IsPropertyAccess); + Assert.AreEqual("set_method6", mc.MethodName); + } [Test] public void MethodNameStripsPrefixOnProperties() { MethodCall gc = new MethodCall(property0_get); + Assert.IsTrue(gc.IsPropertyAccess); Assert.AreEqual("Property0", gc.MethodName); MethodCall sc = new MethodCall(property0_set, 1); + Assert.IsTrue(sc.IsPropertyAccess); Assert.AreEqual("Property0", sc.MethodName); } |