From: Choy R. <ch...@us...> - 2005-04-08 01:21:59
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21740/DotNetMock.Tests/Dynamic Modified Files: MethodCallTests.cs Log Message: BUG 1174229 : we should just output "N/A" if we can't stringify method call which is stringified whenever a method call expectation is not met. Index: MethodCallTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic/MethodCallTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MethodCallTests.cs 19 Feb 2005 21:25:37 -0000 1.3 --- MethodCallTests.cs 8 Apr 2005 01:21:50 -0000 1.4 *************** *** 26,29 **** --- 26,31 ---- int Property0 { get; set; } + + void Method5(ToStringThrows x); } interface IMethodsA *************** *** 31,34 **** --- 33,44 ---- void Method3(int x, string y, double z); } + class ToStringThrows + { + public override string ToString() + { + throw new Exception(); + } + + } static readonly MethodInfo method3 = typeof(IMethods).GetMethod("Method3"); *************** *** 42,45 **** --- 52,56 ---- static readonly MethodInfo property0_get = typeof(IMethods).GetMethod("get_Property0"); static readonly MethodInfo property0_set = typeof(IMethods).GetMethod("set_Property0"); + static readonly MethodInfo method5 = typeof(IMethods).GetMethod("Method5"); [Test] public void MethodNameStripsPrefixOnProperties() *************** *** 57,60 **** --- 68,73 ---- mc = new MethodCall(method4); Assert.AreEqual("Method4()", mc.ToString()); + mc = new MethodCall(method5, new ToStringThrows()); + Assert.AreEqual("Method5(x=N/A)", mc.ToString()); } [Test] public void MethodCallEqualsMethodCall() |