From: Choy R. <ch...@us...> - 2005-05-11 04:08:40
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22636/DotNetMock/Dynamic Modified Files: MethodCall.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: MethodCall.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock/Dynamic/MethodCall.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MethodCall.cs 25 Apr 2005 03:26:31 -0000 1.4 --- MethodCall.cs 11 May 2005 04:08:32 -0000 1.5 *************** *** 58,64 **** { string name = _method.Name; ! if ( name.StartsWith("get_") || name.StartsWith("set_") ) { ! name = name.Substring(4); } return name; --- 58,64 ---- { string name = _method.Name; ! if ( IsPropertyAccess ) { ! return name.Substring(4); } return name; *************** *** 66,69 **** --- 66,84 ---- } /// <summary> + /// Are we accessing a property of calling a typical method? + /// </summary> + public bool IsPropertyAccess + { + get + { + if ( ! _method.IsSpecialName ) + { + return false; + } + string name = _method.Name; + return name.StartsWith("get_") || name.StartsWith("set_"); + } + } + /// <summary> /// Check if given and this object represent the same method call. /// </summary> *************** *** 159,163 **** /// </summary> public object[] Arguments { get { return _arguments; } } - } } --- 174,177 ---- |