From: Choy R. <ch...@us...> - 2005-04-08 03:33:09
|
Update of /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic/Generate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24311/DotNetMock.Tests/Dynamic/Generate Modified Files: ClassGeneratorTests.cs Log Message: BUG 1178977 : argument names weren't showing up in assertion failure messages. this is because we didn't define the parameters in our proxy class with names. so I just copied the parameter meta data from the originating type. Index: ClassGeneratorTests.cs =================================================================== RCS file: /cvsroot/dotnetmock/dotnetmock/DotNetMock.Tests/Dynamic/Generate/ClassGeneratorTests.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ClassGeneratorTests.cs 12 Feb 2005 18:10:36 -0000 1.16 --- ClassGeneratorTests.cs 8 Apr 2005 03:33:00 -0000 1.17 *************** *** 112,115 **** --- 112,131 ---- private MethodInfo _methodInfo = null; } + + [Test] public void NamedParametersAvailableInProxy() + { + DirectionalMockedCallHandler dmch = + new DirectionalMockedCallHandler(); + IDirectionalParameters dp = (IDirectionalParameters) + cg.Generate(typeof(IDirectionalParameters), dmch); + Type dpt = dp.GetType(); + MethodInfo mi = dpt.GetMethod("DoWithInParameters"); + ParameterInfo[] pis = mi.GetParameters(); + Assert.AreEqual(2, pis.Length); + Assert.AreEqual(typeof(int), pis[0].ParameterType); + Assert.AreEqual(typeof(string), pis[1].ParameterType); + Assert.AreEqual("a", pis[0].Name); + Assert.AreEqual("b", pis[1].Name); + } [Test] public void GeneratePersistentAssembly() |