From: Choy R. <ch...@us...> - 2005-02-19 21:25:45
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32197/DotNetMock.Tests/Dynamic Modified Files: MethodCallTests.cs Log Message: Put "get_" and "set_" stripping logic for properties in MethodCall.MethodName. So that we can comply with the OOAO edict. Index: MethodCallTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic/MethodCallTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MethodCallTests.cs 19 Feb 2005 07:48:17 -0000 1.2 --- MethodCallTests.cs 19 Feb 2005 21:25:37 -0000 1.3 *************** *** 24,27 **** --- 24,29 ---- void Method4(); void Method4(int a); + + int Property0 { get; set; } } interface IMethodsA *************** *** 38,41 **** --- 40,53 ---- new Type[] { typeof(int) } ); + static readonly MethodInfo property0_get = typeof(IMethods).GetMethod("get_Property0"); + static readonly MethodInfo property0_set = typeof(IMethods).GetMethod("set_Property0"); + + [Test] public void MethodNameStripsPrefixOnProperties() + { + MethodCall gc = new MethodCall(property0_get); + Assert.AreEqual("Property0", gc.MethodName); + MethodCall sc = new MethodCall(property0_set, 1); + Assert.AreEqual("Property0", sc.MethodName); + } [Test] public void MethodCallToString() |