|
From: <sm...@us...> - 2003-08-13 21:23:43
|
Update of /cvsroot/nmock/nmock/test/NMock/Dynamic
In directory sc8-pr-cvs1:/tmp/cvs-serv15955/test/NMock/Dynamic
Modified Files:
ClassGeneratorTest.cs
Log Message:
Changed Call to Invoke
Index: ClassGeneratorTest.cs
===================================================================
RCS file: /cvsroot/nmock/nmock/test/NMock/Dynamic/ClassGeneratorTest.cs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** ClassGeneratorTest.cs 13 Aug 2003 20:44:12 -0000 1.13
--- ClassGeneratorTest.cs 13 Aug 2003 21:19:58 -0000 1.14
***************
*** 82,92 ****
public class InvocationHandlerImpl : IInvocationHandler
{
! public string invokedMethodName;
! public object[] invokedArgs;
! public object Call(string methodName, params object[] args)
{
! invokedMethodName = methodName;
! invokedArgs = args;
return null;
}
--- 82,93 ----
public class InvocationHandlerImpl : IInvocationHandler
{
! public string expectedMethodName;
! public bool wasCalled = false;
! public object Invoke(string methodName, params object[] args)
{
! Assertion.AssertEquals("should be method name", expectedMethodName, methodName);
! Assertion.AssertEquals("Should be no args", 0, args.Length);
! wasCalled = true;
return null;
}
***************
*** 98,103 ****
ClassGenerator cg = new ClassGenerator(typeof(IThingy), handler);
IThingy thingy = (IThingy)cg.Generate();
thingy.NoArgs();
! Assertion.AssertEquals("NoArgs", handler.invokedMethodName);
}
}
--- 99,108 ----
ClassGenerator cg = new ClassGenerator(typeof(IThingy), handler);
IThingy thingy = (IThingy)cg.Generate();
+
+ handler.expectedMethodName = "NoArgs";
+
thingy.NoArgs();
!
! Assertion.Assert("Should have been called ", handler.wasCalled);
}
}
|