|
From: Steve M. <Ste...@ty...> - 2007-05-14 14:51:34
|
I haven't done anything with Mono yet -----Original Message----- From: nmo...@li... [mailto:nmo...@li...] On Behalf Of M. Scott Ford Sent: Monday, May 14, 2007 9:48 AM To: NMock2 Development Discussion Subject: Re: [NMock2-Dev] Fwd: [TDD] Nmock verify Yeah. As I said in my blog, I think that this is a problem with the .Net framework, and not with NMock. Have you tried to see if you can=20 reproduce the problem with Mono? Steve Mitcham wrote: > I copied your test case from your blog into the acceptance tests on my > version and the casting problem is still exhibited. > > -----Original Message----- > From: nmo...@li... > [mailto:nmo...@li...] On Behalf Of M. > Scott Ford > Sent: Monday, May 14, 2007 9:11 AM > To: NMock2 Development Discussion > Subject: Re: [NMock2-Dev] Fwd: [TDD] Nmock verify > > I wrote a few blog[1] posts[2] about this a long time ago. I am not sure > > if they are still relevant, but they may help. > > [1]: http://vaderpi.scottandlaurie.com/blog/?p=3D184 > [2]: http://vaderpi.scottandlaurie.com/blog/?p=3D188 > > Mike Capp wrote: > =20 >> Hi Steve, >> >> I found your old mails on this subject while poking through the nmock >> list archives regarding a similar issue - an InvalidCastException on >> >> ArrayList list =3D new ArrayList(); >> list.Add(mockery.NewMock(typeof(IFoo))); >> IFoo[] array =3D (IFoo[]) list.ToArray(typeof(IFoo)); >> >> which I suspect has the same root cause as your IServiceContainer >> woes. Unfortunately, SourceForge's web archives don't include patches >> attached to mails (I only joined the project recently and so don't >> have the originals) and I didn't have your email until it popped up in >> this thread. Do you by any chance still have them handy? I'm not a >> project admin and so can't give you commit access, but I should be >> able to apply your fixes and check them in. >> >> cheers >> Mike >> >> >> On 04/05/07, Steve Mitcham <Ste...@ty...> wrote: >> =20 >> =20 >>> I've submitted a patch to a major issue that I've come up against, >>> =20 > that > =20 >>> I believe covers an open error in the bug list, several times only to >>> have the patch submission be completely ignored. I gave up sending >>> information to the lists a long time ago due to this behavior. I can >>> understand a patch being rejected, but I got no feedback whatsoever >>> =20 > to > =20 >>> my attempts. This occurred over the course of several months about a >>> year ago. The issue still exists. I don't have time to look up the >>> exact defect I'm talking about, however, the symptom of the problem >>> =20 > I'm > =20 >>> experiencing boils down to the following test: >>> >>> [Test] >>> public void MockObjectsCanBeContainedInServiceContainer() >>> { >>> Mockery mockery =3D new Mockery(); >>> ServiceContainer container =3D new = ServiceContainer(); >>> IMockedType mockedType =3D mockery.NewMock(typeof >>> (IMockedType)) as IMockedType; >>> >>> container.AddService(typeof >>> =20 > (IMockedType),mockedType); > =20 >>> Assert.AreSame(mockedType,container.GetService(typeof(IMockedType))); >>> } >>> >>> I have a patch that my company uses that fixes this issue and also >>> allows for the following functionality: >>> >>> [Test] >>> public void EventsCanBeRaisedDuringTests() >>> { >>> m_listenerMessage =3D null; >>> Mockery mocks =3D new Mockery(); >>> Announcer announcer =3D (Announcer) >>> mocks.NewMock(typeof(Announcer)); >>> >>> >>> =20 > Expect.Once.On(announcer).EventAdd("Listeners", > =20 >>> new Listener(DummyListener)); >>> >>> announcer.Listeners +=3D new >>> Listener(DummyListener); >>> >>> >>> =20 > Fire.Event("Listeners").On(announcer).With("Test > =20 >>> Message"); >>> >>> Assert.AreEqual("Test >>> Message",m_listenerMessage); >>> } >>> >>> >>> Finally, I have a patch to an issue raise several months ago >>> =20 > concerning > =20 >>> Verification of expectations when ordered expectations are used, also >>> =20 > a > =20 >>> major problem that remains unpatched to date as far as I can tell. >>> =20 >>> =20 >> =20 > ------------------------------------------------------------------------ > - > =20 >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> _______________________________________________ >> NMock-two-dev mailing list >> NMo...@li... >> https://lists.sourceforge.net/lists/listinfo/nmock-two-dev >> =20 >> =20 > > > > ------------------------------------------------------------------------ > - > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > NMock-two-dev mailing list > NMo...@li... > https://lists.sourceforge.net/lists/listinfo/nmock-two-dev > > ------------------------------------------------------------------------ - > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > NMock-two-dev mailing list > NMo...@li... > https://lists.sourceforge.net/lists/listinfo/nmock-two-dev > =20 ------------------------------------------------------------------------ - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ NMock-two-dev mailing list NMo...@li... https://lists.sourceforge.net/lists/listinfo/nmock-two-dev |