From: Steve M. <Ste...@ty...> - 2007-12-21 14:17:31
|
To be honest, I haven't had the opportunity to upgrade and run the tests on a machine with 2008 installed. I'm not authorized to upgrade my work machine. Has anyone else? If not, then I'll try to get to it this weekend after I get my home computer up and running. I've been having some CPU issues recently. =20 If you can get the project from sourceforge and run the unit tests, that would help see if it is something inherent in 2008 or if it is something that you've done wrong, although I can't imagine it is something you did. =20 Also, what framework are you targeting? From: nmo...@li... [mailto:nmo...@li...] On Behalf Of Hans Voet Sent: Friday, December 21, 2007 3:46 AM To: nmo...@li... Subject: [Nmock-general] System.ArgumentException in VS2008 =20 Hi, recently our team shifted from VS2005 to VS2008. =20 All went ok in VS2005, but the unit tests containing NMock(2) objects currently fail in VS2008, because of a System.ArgumentException. =20 code snippet:=20 =20 using NUnit.Framework; using Security; using NMock2; =20 (...) =20 Password password; IPasswordVerification passwordVerification; Mockery mockery; =20 [TestFixtureSetUp] public void tst_PasswordSetup() { mockery =3D new Mockery();=20 passwordVerification =3D mockery.NewMock<IPasswordVerification>(); password =3D new Password(passwordVerification); } =20 a watch on passwordVerification reveals the following: =20 base System.ArgumentException: Field 'mockedType' defined on type 'NMock2.Mockery+MockObject' is not a field on the target object which is of type 'NMock2.Mockery+MockObject'. at System.Reflection.RtFieldInfo.CheckConsistency(Object target) at System.Reflection.RtFieldInfo.InternalGetValue(Object obj, Boolean doVisibilityCheck, Boolean doCheckConsistency) at System.Reflection.RtFieldInfo.GetValue(Object obj) at Microsoft.Office.Tools.Debugger.Tools.TryCreateDebuggerItem(MemberInfo member, Object target, __Item& item) Microsoft.Office.Tools.Debugger.__Item {Microsoft.Office.Tools.Debugger.__Exception} I get the same error for the mockery and name properties on the mock object. The same example works fine in VS2005. =20 Anyone having the same troubles? Did I forget something...? =20 Any help will be appreciated. =20 Grtz, =20 hv =20 =20 =20 ________________________________ Neem je vrienden overal mee dankzij Messenger op je gsm. Messenger voor Mobile <http://get.live.com/mobile/messenger>=20 |