From: Hans V. <hv...@ho...> - 2007-12-21 09:45:38
|
Hi, recently our team shifted from VS2005 to VS2008. =20 All went ok in VS2005, but the unit tests containing NMock(2) objects curre= ntly 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<IPasswordVerif= ication>(); 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.CheckConsist= ency(Object target) at System.Reflection.RtFieldInfo.InternalGetValue(Obj= ect obj, Boolean doVisibilityCheck, Boolean doCheckConsistency) at System= .Reflection.RtFieldInfo.GetValue(Object obj) at Microsoft.Office.Tools.De= bugger.Tools.TryCreateDebuggerItem(MemberInfo member, Object target, __Item= & item) Microsoft.Office.Tools.Debugger.__Item {Microsoft.Office.Tools.Debu= gger.__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 _________________________________________________________________ Start vandaag nog je eigen Windows Live Space en deel je leven met je vrien= den http://spaces.live.com= |