You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(31) |
Dec
(26) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(8) |
Feb
(27) |
Mar
(15) |
Apr
|
May
(2) |
Jun
(13) |
Jul
(59) |
Aug
(48) |
Sep
(9) |
Oct
(4) |
Nov
(24) |
Dec
|
| 2004 |
Jan
(24) |
Feb
(2) |
Mar
(12) |
Apr
(9) |
May
(4) |
Jun
(26) |
Jul
(20) |
Aug
(23) |
Sep
(13) |
Oct
(31) |
Nov
(23) |
Dec
(11) |
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
(19) |
May
(64) |
Jun
(7) |
Jul
(20) |
Aug
(1) |
Sep
(6) |
Oct
|
Nov
(3) |
Dec
|
| 2006 |
Jan
|
Feb
(69) |
Mar
(18) |
Apr
(1) |
May
(4) |
Jun
(3) |
Jul
(27) |
Aug
(19) |
Sep
(12) |
Oct
(3) |
Nov
(13) |
Dec
(6) |
| 2007 |
Jan
(20) |
Feb
(17) |
Mar
(1) |
Apr
(3) |
May
(4) |
Jun
(11) |
Jul
(10) |
Aug
(24) |
Sep
(19) |
Oct
(13) |
Nov
(8) |
Dec
(7) |
| 2008 |
Jan
(54) |
Feb
(24) |
Mar
(11) |
Apr
(35) |
May
(13) |
Jun
(10) |
Jul
(30) |
Aug
(18) |
Sep
(21) |
Oct
(18) |
Nov
(40) |
Dec
(76) |
| 2009 |
Jan
(64) |
Feb
(23) |
Mar
(15) |
Apr
(23) |
May
(46) |
Jun
(25) |
Jul
(31) |
Aug
(7) |
Sep
(7) |
Oct
(6) |
Nov
(15) |
Dec
(19) |
| 2010 |
Jan
(13) |
Feb
(8) |
Mar
(6) |
Apr
(4) |
May
(8) |
Jun
(7) |
Jul
(3) |
Aug
(9) |
Sep
(6) |
Oct
(15) |
Nov
(3) |
Dec
(5) |
| 2011 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
(5) |
May
(2) |
Jun
|
Jul
(2) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(2) |
Dec
(3) |
| 2012 |
Jan
(6) |
Feb
(2) |
Mar
(3) |
Apr
(3) |
May
(3) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
| 2013 |
Jan
(3) |
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
| 2015 |
Jan
|
Feb
(19) |
Mar
(115) |
Apr
(23) |
May
(41) |
Jun
(48) |
Jul
(59) |
Aug
(29) |
Sep
(40) |
Oct
(78) |
Nov
(58) |
Dec
(47) |
| 2016 |
Jan
(25) |
Feb
(30) |
Mar
(29) |
Apr
(10) |
May
(17) |
Jun
(1) |
Jul
(1) |
Aug
(6) |
Sep
(2) |
Oct
(1) |
Nov
(3) |
Dec
(2) |
| 2017 |
Jan
(5) |
Feb
(2) |
Mar
(7) |
Apr
(1) |
May
(7) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
(1) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(3) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
(29) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(5) |
Dec
(3) |
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
(7) |
Jul
(1) |
Aug
|
Sep
(6) |
Oct
(4) |
Nov
(1) |
Dec
(4) |
| 2024 |
Jan
(2) |
Feb
(5) |
Mar
|
Apr
|
May
(8) |
Jun
(159) |
Jul
(90) |
Aug
(22) |
Sep
|
Oct
(6) |
Nov
(8) |
Dec
(1) |
| 2025 |
Jan
(20) |
Feb
(6) |
Mar
(2) |
Apr
(4) |
May
(29) |
Jun
(63) |
Jul
(62) |
Aug
(70) |
Sep
(120) |
Oct
(46) |
Nov
(33) |
Dec
(25) |
| 2026 |
Jan
(37) |
Feb
(56) |
Mar
(62) |
Apr
(35) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Dean H. <dea...@Bo...> - 2005-04-21 15:57:29
|
I was expecting it has some intrusion like createMockObject that all = mock libs would have, but that would be it. I haven't looked at it yet = and may react differently once I see it. =20 I do agree that there should be something as designs do tend to be = cleaner when designing for tests upfront. dean -----Original Message----- From: Nat Pryce [mailto:nat...@gm...]=20 Sent: Thursday, April 21, 2005 9:51 AM To: Dean Hiller Cc: Thibaut Barr=E8re; Steve Freeman; Steve Baker; = nmo...@li... Subject: Re: [Nmock-general] TypeMock vs. NMock Without any intrusion, how will it guide design? --Nat. On 4/21/05, Dean Hiller <dea...@bo...> wrote: > Very interesting. Hibernate does the same thing(and I assume = NHibernate also). In practice, you never even notice the intrusion. = You write plain old java beans and you can get rid of Hibernate at will = because of that. It is quite nice. I am thinking the route TypeMock = took may be nice also as I don't see the intrusion therefore it doesn't = exist :). Well, it exists, but I am not sure it bothers me as long as = it is stable. If it was unstable, it might be a bit harder to debug the = problem which I wouldn't like. > dean >=20 > -----Original Message----- > From: Thibaut Barr=E8re [mailto:thi...@gm...] > Sent: Thursday, April 21, 2005 7:16 AM > To: Steve Freeman > Cc: Steve Baker; Dean Hiller; <nmo...@li...>; = Nat Pryce > Subject: Re: [Nmock-general] TypeMock vs. NMock >=20 > A small note on TypeMock; after reading a few docs, it seems that the > approach (at least for real typemocks) is quite different : it seems > to be instrumenting the IL (this allow more things without redesigning > at all, but is also more instrusive IMHO). >=20 > any other opinion ? >=20 > 2005/4/20, Steve Freeman <st...@m3...>: > > On 19 Apr 2005, at 21:28, Steve Baker wrote: > > > Yeah, it is a rather dead mailing list :( > > > > > > I use NMock, never looked at TypeMock though. > > > > > > Nmock has almost always had everything I needed. We even use it to > > > Mock out our SqlHelper class (slightly modified from DAAB) so that = our > > > tests never hit a database. It is quick and easy :) > > > > Not dead, just not very active :) largely because no-one has been > > asking for stuff. That said, Nat has started work on porting our = jMock > > experience to C# and has come up with some very nice constructs. > > Unfortunately, his day job seems to keep getting in the way :) Watch > > this space. > > > > S. > > > > >=20 > -------------------------------------------------------- > The information contained in this e-mail and any attachments hereto = are for the exclusive use of the addressee and may contain confidential, = privileged and nondisclosable information. If the recipient of this = e-mail is not the addressee, or a person responsible for delivering this = e-mail to the addressee, such recipient is strictly prohibited from = reading, printing, photocopying, distributing or otherwise using this = e-mail or any attachments hereto in any way. If the recipient has = received this e-mail in error, please send return e-mail immediately = notifying us of your receipt of this e-mail and delete the e-mail from = your inbox. Thank you. > |
|
From: Nat P. <nat...@gm...> - 2005-04-21 15:55:24
|
Without any intrusion, how will it guide design? --Nat. On 4/21/05, Dean Hiller <dea...@bo...> wrote: > Very interesting. Hibernate does the same thing(and I assume NHibernate = also). In practice, you never even notice the intrusion. You write plain = old java beans and you can get rid of Hibernate at will because of that. I= t is quite nice. I am thinking the route TypeMock took may be nice also as= I don't see the intrusion therefore it doesn't exist :). Well, it exists,= but I am not sure it bothers me as long as it is stable. If it was unstab= le, it might be a bit harder to debug the problem which I wouldn't like. > dean >=20 > -----Original Message----- > From: Thibaut Barr=E8re [mailto:thi...@gm...] > Sent: Thursday, April 21, 2005 7:16 AM > To: Steve Freeman > Cc: Steve Baker; Dean Hiller; <nmo...@li...>; Nat = Pryce > Subject: Re: [Nmock-general] TypeMock vs. NMock >=20 > A small note on TypeMock; after reading a few docs, it seems that the > approach (at least for real typemocks) is quite different : it seems > to be instrumenting the IL (this allow more things without redesigning > at all, but is also more instrusive IMHO). >=20 > any other opinion ? >=20 > 2005/4/20, Steve Freeman <st...@m3...>: > > On 19 Apr 2005, at 21:28, Steve Baker wrote: > > > Yeah, it is a rather dead mailing list :( > > > > > > I use NMock, never looked at TypeMock though. > > > > > > Nmock has almost always had everything I needed. We even use it to > > > Mock out our SqlHelper class (slightly modified from DAAB) so that ou= r > > > tests never hit a database. It is quick and easy :) > > > > Not dead, just not very active :) largely because no-one has been > > asking for stuff. That said, Nat has started work on porting our jMock > > experience to C# and has come up with some very nice constructs. > > Unfortunately, his day job seems to keep getting in the way :) Watch > > this space. > > > > S. > > > > >=20 > -------------------------------------------------------- > The information contained in this e-mail and any attachments hereto are f= or the exclusive use of the addressee and may contain confidential, privile= ged and nondisclosable information. If the recipient of this e-mail is not = the addressee, or a person responsible for delivering this e-mail to the ad= dressee, such recipient is strictly prohibited from reading, printing, phot= ocopying, distributing or otherwise using this e-mail or any attachments he= reto in any way. If the recipient has received this e-mail in error, please= send return e-mail immediately notifying us of your receipt of this e-mail= and delete the e-mail from your inbox. Thank you. > |
|
From: Dean H. <dea...@Bo...> - 2005-04-21 14:31:10
|
Very interesting. Hibernate does the same thing(and I assume NHibernate = also). In practice, you never even notice the intrusion. You write = plain old java beans and you can get rid of Hibernate at will because of = that. It is quite nice. I am thinking the route TypeMock took may be = nice also as I don't see the intrusion therefore it doesn't exist :). = Well, it exists, but I am not sure it bothers me as long as it is = stable. If it was unstable, it might be a bit harder to debug the = problem which I wouldn't like. =20 dean -----Original Message----- From: Thibaut Barr=E8re [mailto:thi...@gm...]=20 Sent: Thursday, April 21, 2005 7:16 AM To: Steve Freeman Cc: Steve Baker; Dean Hiller; <nmo...@li...>; Nat = Pryce Subject: Re: [Nmock-general] TypeMock vs. NMock A small note on TypeMock; after reading a few docs, it seems that the approach (at least for real typemocks) is quite different : it seems to be instrumenting the IL (this allow more things without redesigning at all, but is also more instrusive IMHO). any other opinion ? 2005/4/20, Steve Freeman <st...@m3...>: > On 19 Apr 2005, at 21:28, Steve Baker wrote: > > Yeah, it is a rather dead mailing list :( > > > > I use NMock, never looked at TypeMock though. > > > > Nmock has almost always had everything I needed. We even use it to > > Mock out our SqlHelper class (slightly modified from DAAB) so that = our > > tests never hit a database. It is quick and easy :) >=20 > Not dead, just not very active :) largely because no-one has been > asking for stuff. That said, Nat has started work on porting our jMock > experience to C# and has come up with some very nice constructs. > Unfortunately, his day job seems to keep getting in the way :) Watch > this space. >=20 > S. >=20 > -------------------------------------------------------- The information contained in this e-mail and any attachments hereto are = for the exclusive use of the addressee and may contain confidential, = privileged and nondisclosable information. If the recipient of this = e-mail is not the addressee, or a person responsible for delivering this = e-mail to the addressee, such recipient is strictly prohibited from = reading, printing, photocopying, distributing or otherwise using this = e-mail or any attachments hereto in any way. If the recipient has = received this e-mail in error, please send return e-mail immediately = notifying us of your receipt of this e-mail and delete the e-mail from = your inbox. Thank you. |
|
From: Steve F. <st...@m3...> - 2005-04-19 22:34:01
|
On 19 Apr 2005, at 21:28, Steve Baker wrote: > Yeah, it is a rather dead mailing list :( > > I use NMock, never looked at TypeMock though. > > Nmock has almost always had everything I needed. We even use it to > Mock out our SqlHelper class (slightly modified from DAAB) so that our > tests never hit a database. It is quick and easy :) Not dead, just not very active :) largely because no-one has been asking for stuff. That said, Nat has started work on porting our jMock experience to C# and has come up with some very nice constructs. Unfortunately, his day job seems to keep getting in the way :) Watch this space. S. |
|
From: Steve B. <St...@ma...> - 2005-04-19 20:28:15
|
Yeah, it is a rather dead mailing list :( I use NMock, never looked at TypeMock though. Nmock has almost always had everything I needed. We even use it to Mock = out our SqlHelper class (slightly modified from DAAB) so that our tests = never hit a database. It is quick and easy :) Steve Baker Senior Consultant Magenic Technologies Nobody's more serious about Microsoft. At the end of the day, it's all just 1's and 0's. =20 -----Original Message----- From: nmo...@li... = [mailto:nmo...@li...] On Behalf Of Dean = Hiller Sent: Tuesday, April 19, 2005 3:12 PM To: Thibaut Barr=E8re; nmo...@li... Subject: RE: [Nmock-general] TypeMock vs. NMock I would like this too. Is there anyone on the NMock mailing list that = has comments on NMock? Seems rather dead here. Thanks, dean -----Original Message----- From: nmo...@li... = [mailto:nmo...@li...] On Behalf Of Thibaut = Barr=E8re Sent: Tuesday, April 19, 2005 8:03 AM To: nmo...@li... Subject: [Nmock-general] TypeMock vs. NMock Hi again, I've noticed that on TypeMock website there's a comparison of features between NMock and TypeMock (for which I don't totally agree, eg: to me NMock has a "Verify" mode). http://www.typemock.com/Features.htm Do you know this framework already ? How does it compare to NMock, from a NMock user/developer point of view (I'd like to have the other side of the "feature comparison" :) best regards Thibaut ------------------------------------------------------- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime = info, new features, or free trial, at: = http://www.businessobjects.com/devxi/728 _______________________________________________ Nmock-general mailing list Nmo...@li... https://lists.sourceforge.net/lists/listinfo/nmock-general -------------------------------------------------------- The information contained in this e-mail and any attachments hereto are = for the exclusive use of the addressee and may contain confidential, = privileged and nondisclosable information. If the recipient of this = e-mail is not the addressee, or a person responsible for delivering this = e-mail to the addressee, such recipient is strictly prohibited from = reading, printing, photocopying, distributing or otherwise using this = e-mail or any attachments hereto in any way. If the recipient has = received this e-mail in error, please send return e-mail immediately = notifying us of your receipt of this e-mail and delete the e-mail from = your inbox. Thank you. ------------------------------------------------------- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime = info, new features, or free trial, at: = http://www.businessobjects.com/devxi/728 _______________________________________________ Nmock-general mailing list Nmo...@li... https://lists.sourceforge.net/lists/listinfo/nmock-general |
|
From: Dean H. <dea...@Bo...> - 2005-04-19 20:12:00
|
I would like this too. Is there anyone on the NMock mailing list that = has comments on NMock? Seems rather dead here. Thanks, dean -----Original Message----- From: nmo...@li... = [mailto:nmo...@li...] On Behalf Of Thibaut = Barr=E8re Sent: Tuesday, April 19, 2005 8:03 AM To: nmo...@li... Subject: [Nmock-general] TypeMock vs. NMock Hi again, I've noticed that on TypeMock website there's a comparison of features between NMock and TypeMock (for which I don't totally agree, eg: to me NMock has a "Verify" mode). http://www.typemock.com/Features.htm Do you know this framework already ? How does it compare to NMock, from a NMock user/developer point of view (I'd like to have the other side of the "feature comparison" :) best regards Thibaut ------------------------------------------------------- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime = info, new features, or free trial, at: = http://www.businessobjects.com/devxi/728 _______________________________________________ Nmock-general mailing list Nmo...@li... https://lists.sourceforge.net/lists/listinfo/nmock-general -------------------------------------------------------- The information contained in this e-mail and any attachments hereto are = for the exclusive use of the addressee and may contain confidential, = privileged and nondisclosable information. If the recipient of this = e-mail is not the addressee, or a person responsible for delivering this = e-mail to the addressee, such recipient is strictly prohibited from = reading, printing, photocopying, distributing or otherwise using this = e-mail or any attachments hereto in any way. If the recipient has = received this e-mail in error, please send return e-mail immediately = notifying us of your receipt of this e-mail and delete the e-mail from = your inbox. Thank you. |
|
From: <thi...@gm...> - 2005-04-19 14:03:10
|
Hi again, I've noticed that on TypeMock website there's a comparison of features between NMock and TypeMock (for which I don't totally agree, eg: to me NMock has a "Verify" mode). http://www.typemock.com/Features.htm Do you know this framework already ? How does it compare to NMock, from a NMock user/developer point of view (I'd like to have the other side of the "feature comparison" :) best regards Thibaut |
|
From: Dean H. <dea...@Bo...> - 2005-04-19 13:28:32
|
If there is no way at this time, I would be happy to port java's mocklib = to C#! Thanks, dean -----Original Message----- From: Thibaut Barr=E8re [mailto:thi...@gm...]=20 Sent: Tuesday, April 19, 2005 3:36 AM To: Dean Hiller Cc: nmo...@li... Subject: Re: [Nmock-general] asynchronous testing Hi I'm also interested in feedback on multithreaded testing from NMock = users/devs. I sometimes do a manual wait with a timeout, but maybe there's a better way already ? regards Thibaut Barr=E8re http://www.dotnetguru2.org/tbarrere 2005/4/18, Dean Hiller <dea...@bo...>: > =20 > =20 > =20 >=20 > Is there a way to use NMock to test subsystems that have different = threads.=20 >=20 > =20 >=20 > Ie. I want to do something like this=20 >=20 > =20 >=20 > mockListener.setTimeout(10000);=20 >=20 > =20 >=20 > SysUnderTest.addClientListener(mockListener);=20 >=20 > SysUnderTest.invokeToStart();=20 >=20 > =20 >=20 > CalledMethod m =3D = mockListener.expectMethodCall("someMethodOnListener");=20 >=20 > =20 >=20 > Where expectMethodCall actually does a Monitor.Wait(timeout) because = the > method "someMethodOnListener" is=20 >=20 > Invoked on a different thread and not invoked on the > SysUnderTest.invokeToStart() client thread(ie. The test thread)=20 >=20 > =20 >=20 > Is there a way to do this? Java's mocklib does this very nicely for = this > type of testing.=20 >=20 > =20 >=20 > Thanks,=20 >=20 > dean=20 >=20 > ________________________________ > The information contained in this e-mail and any attachments hereto = are for > the exclusive use of the addressee and may contain confidential, = privileged > and nondisclosable information. If the recipient of this e-mail is not = the > addressee, or a person responsible for delivering this e-mail to the > addressee, such recipient is strictly prohibited from reading, = printing, > photocopying, distributing or otherwise using this e-mail or any = attachments > hereto in any way. If the recipient has received this e-mail in error, > please send return e-mail immediately notifying us of your receipt of = this > e-mail and delete the e-mail from your inbox. Thank you. |
|
From: <thi...@gm...> - 2005-04-19 09:35:46
|
Hi I'm also interested in feedback on multithreaded testing from NMock users/d= evs. I sometimes do a manual wait with a timeout, but maybe there's a better way already ? regards Thibaut Barr=E8re http://www.dotnetguru2.org/tbarrere 2005/4/18, Dean Hiller <dea...@bo...>: > =20 > =20 > =20 >=20 > Is there a way to use NMock to test subsystems that have different thread= s.=20 >=20 > =20 >=20 > Ie. I want to do something like this=20 >=20 > =20 >=20 > mockListener.setTimeout(10000);=20 >=20 > =20 >=20 > SysUnderTest.addClientListener(mockListener);=20 >=20 > SysUnderTest.invokeToStart();=20 >=20 > =20 >=20 > CalledMethod m =3D mockListener.expectMethodCall("someMethodOnListener");= =20 >=20 > =20 >=20 > Where expectMethodCall actually does a Monitor.Wait(timeout) because the > method "someMethodOnListener" is=20 >=20 > Invoked on a different thread and not invoked on the > SysUnderTest.invokeToStart() client thread(ie. The test thread)=20 >=20 > =20 >=20 > Is there a way to do this? Java's mocklib does this very nicely for this > type of testing.=20 >=20 > =20 >=20 > Thanks,=20 >=20 > dean=20 >=20 > ________________________________ > The information contained in this e-mail and any attachments hereto are = for > the exclusive use of the addressee and may contain confidential, privileg= ed > and nondisclosable information. If the recipient of this e-mail is not th= e > addressee, or a person responsible for delivering this e-mail to the > addressee, such recipient is strictly prohibited from reading, printing, > photocopying, distributing or otherwise using this e-mail or any attachme= nts > hereto in any way. If the recipient has received this e-mail in error, > please send return e-mail immediately notifying us of your receipt of thi= s > e-mail and delete the e-mail from your inbox. Thank you. |
|
From: Dean H. <dea...@Bo...> - 2005-04-18 21:49:01
|
Is there a way to use NMock to test subsystems that have different
threads.
=20
Ie. I want to do something like this
=20
mockListener.setTimeout(10000);
=20
SysUnderTest.addClientListener(mockListener);
SysUnderTest.invokeToStart();
=20
CalledMethod m =3D =
mockListener.expectMethodCall("someMethodOnListener");
=20
Where expectMethodCall actually does a Monitor.Wait(timeout) because the
method "someMethodOnListener" is
Invoked on a different thread and not invoked on the
SysUnderTest.invokeToStart() client thread(ie. The test thread)
=20
Is there a way to do this? Java's mocklib does this very nicely for
this type of testing.
=20
Thanks,
dean
--------------------------------------------------------
The information contained in this e-mail and any attachments hereto are =
for the exclusive use of the addressee and may contain confidential, =
privileged and nondisclosable information. If the recipient of this =
e-mail is not the addressee, or a person responsible for delivering this =
e-mail to the addressee, such recipient is strictly prohibited from =
reading, printing, photocopying, distributing or otherwise using this =
e-mail or any attachments hereto in any way. If the recipient has =
received this e-mail in error, please send return e-mail immediately =
notifying us of your receipt of this e-mail and delete the e-mail from =
your inbox. Thank you.
|
|
From: Owen R. <exo...@us...> - 2004-12-20 06:21:27
|
Update of /cvsroot/nmock/nmock/test/NMock In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29748/test/NMock Modified Files: TypeCheckedMockTest.cs Log Message: jim's patch for arguments with ref parameter Index: TypeCheckedMockTest.cs =================================================================== RCS file: /cvsroot/nmock/nmock/test/NMock/TypeCheckedMockTest.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TypeCheckedMockTest.cs 22 Oct 2004 11:46:27 -0000 1.3 --- TypeCheckedMockTest.cs 20 Dec 2004 06:21:16 -0000 1.4 *************** *** 213,216 **** --- 213,217 ---- void MethodWithRefParameter(ref string p); void MethodWithRefParameter(ref char p); + void MethodWithRefArrayParameter(ref string[] s); } *************** *** 251,254 **** --- 252,266 ---- [Test] + public void CanExpectOnMethodWithRefArrayParameter() + { + IMock mock = new DynamicMock(typeof(IFoo)); + string[] someStrings = new string[] {"a", "b"}; + mock.Expect("MethodWithRefArrayParameter", (object) someStrings); + IFoo foo = (IFoo)mock.MockInstance; + foo.MethodWithRefArrayParameter(ref someStrings); + mock.Verify(); + } + + [Test] public void CannotYetMockMembersWithOnlyAParamsArgument() { |
|
From: Owen R. <exo...@us...> - 2004-12-20 06:21:25
|
Update of /cvsroot/nmock/nmock/src/NMock/Dynamic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29748/src/NMock/Dynamic Modified Files: MethodSignature.cs Log Message: jim's patch for arguments with ref parameter Index: MethodSignature.cs =================================================================== RCS file: /cvsroot/nmock/nmock/src/NMock/Dynamic/MethodSignature.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MethodSignature.cs 17 Sep 2004 03:33:46 -0000 1.1 --- MethodSignature.cs 20 Dec 2004 06:21:16 -0000 1.2 *************** *** 41,45 **** foreach (ParameterInfo parameter in method.GetParameters()) { ! types.Add(parameter.ParameterType); } return (Type[]) types.ToArray(typeof (Type)); --- 41,52 ---- foreach (ParameterInfo parameter in method.GetParameters()) { ! if(parameter.ParameterType.IsByRef) ! { ! types.Add(parameter.ParameterType.GetElementType()); ! } ! else ! { ! types.Add(parameter.ParameterType); ! } } return (Type[]) types.ToArray(typeof (Type)); |
|
From: Dominik F. <li...@ro...> - 2004-12-17 22:50:25
|
Hi Jim
Yes, the function should set new values to the refered array.
It would be nice if you could implement such a functionality in nmock. I
didn't know if i still work on this projject after the holidays, but if
yes, i'll be eager to test it :)
Dominik
Jim Arnold wrote:
> I understand now. You really want to set a result on the ref
> parameter. There's no reason why NMock couldn't be changed to allow
> this; I think it's a valid enhancement and I'd like to work on it.
> Maybe if I get some time over the holidays :-)
>
> Jim
>
> ThoughtWorks
> -----nmo...@li... wrote: -----
>
> To: Jim Arnold <JA...@th...>
> From: Dominik Fretz <li...@ro...>
> Sent by: nmo...@li...
> Date: 12/16/2004 11:02PM
> cc: nmo...@li...
> Subject: Re: [Nmock-general] Problem with 'ref string[]' parameter
>
> Hi Jim
>
> Thank you for your fast answer & bug fix!
>
> Probably my test is a bit too constructed to display the miss
> behaivior ...
>
> The concrete problem was in a existing project of mine.
> There is a given library with a more or less simple behavior, Its
> a database abstraction lib.
> There are structs for the rows of a table, and a function to fill
> a array of this structs for a select statement.
> The function, as example 'GetJobsForCustomer' looks like this:
> public bool GetJobsForCustomer(int customerId, ref JobRow[] rows)
>
> Call the function, i have to create a new, but null assinged
> JobRow array, and pass this by reference.
> If the function returned true, it successed, and my rows array
> contains all the JobsRow's for the customer.
>
> It tried to create a DynamicMock for this behavior ... but it
> seams that this is a bit out of the probabbilities
> of nmock. I think i have to implement a mock by myself.
>
> But thank you for fixing the bug so fast!
>
> and sorry for the 'mail-adress-mess', i posted the first massage
> over a webmail that was not successfully configured.
>
> Greethings
> Dominik
>
>
> Jim Arnold wrote:
>
>> Yes, there is a bug, but I'm a little confused by your
>> test. NMock will only verify the value of a parameter, not the
>> actual reference. In your test, you assign the variable
>> 'refStringArr' to null, then pass it to your mock. This will
>> fail (assuming the bug has been fixed) because NMock is expecting
>> the original value assigned to strArr, which was {"a", "b"}.
>> Even if NMock could have compared the reference refStringArr with
>> strArr, however, it still would have failed, because they are
>> different references. So I'm not sure what you expect the
>> behavior to be.
>> Anyway, I have fixed the bug, and it should make its way onto
>> SourceForge in the next day or so.
>> Jim
>> ThoughtWorks
>
>
>
> ------------------------------------------------------- SF email is
> sponsored by - The IT Product Guide Read honest & candid reviews on
> hundreds of IT Products from real users. Discover which products truly
> live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________ Nmock-general mailing
> list Nmo...@li...
> https://lists.sourceforge.net/lists/listinfo/nmock-general
|
|
From: Jim A. <JA...@th...> - 2004-12-17 11:15:41
|
<FONT face=3D"Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=
=3D2><DIV>I understand now. You really want to set a result on the re=
f parameter. There's no reason why NMock couldn't be changed to allow=
this; I think it's a valid enhancement and I'd like to work on it. M=
aybe if I get some time over the holidays :-)</DIV><DIV> </DIV><DIV>Ji=
m</DIV><DIV> </DIV><DIV>ThoughtWorks<BR></DIV><FONT color=3D#990099>--=
---nmo...@li... wrote: -----<BR><BR></FONT><bl=
ockquote style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">To: Jim Arnold <JArno=
ld...@th...><BR>From: Dominik Fretz <li...@ro...><BR>S=
ent by: nmo...@li...<BR>Date: 12/16/2004 11:02=
PM<BR>cc: nmo...@li...<BR>Subject: Re: [Nmock-genera=
l] Problem with 'ref string[]' parameter<BR><BR>Hi Jim <BR><BR>Thank you fo=
r your fast answer & bug fix! <BR><BR>Probably my test is a bit too con=
structed to display the miss behaivior ... <BR><BR>The concrete problem was=
in a existing project of mine. <BR>There is a given library with a more or=
less simple behavior, Its a database abstraction lib. <BR>There are struct=
s for the rows of a table, and a function to fill a array of this structs f=
or a select statement. <BR>The function, as example 'GetJobsForCustomer' lo=
oks like this: <BR>public bool GetJobsForCustomer(int customerId, ref JobRo=
w[] rows) <BR><BR>Call the function, i have to create a new, but null assin=
ged JobRow array, and pass this by reference. <BR>If the function returned =
true, it successed, and my rows array contains all the JobsRow's for the cu=
stomer. <BR><BR>It tried to create a DynamicMock for this behavior ... but =
it seams that this is a bit out of the probabbilities <BR>of nmock. I think=
i have to implement a mock by myself. <BR><BR>But thank you for fixing the=
bug so fast! <BR><BR>and sorry for the 'mail-adress-mess', i posted the fi=
rst massage over a webmail that was not successfully configured. <BR><BR>Gr=
eethings <BR>Dominik <BR><BR><BR>Jim Arnold wrote: <BLOCKQUOTE cite=3DmidOF=
C8F...@th... ty=
pe=3D"cite"><FONT face=3D"Default Sans Serif,Verdana,Arial,Helvetica,sans-s=
erif" size=3D2><DIV>Yes, there is a bug, but I'm a little confused by your =
test. NMock will only verify the value of a parameter, not the a=
ctual reference. In your test, you assign the variable 'refStringArr'=
to null, then pass it to your mock. This will fail (assuming the bug=
has been fixed) because NMock is expecting the original value assigned to =
strArr, which was {"a", "b"}. Even if NMock could have compared the r=
eference refStringArr with strArr, however, it still would have failed, bec=
ause they are different references. So I'm not sure what you expect t=
he behavior to be. </DIV><DIV> </DIV><DIV>Anyway, I have fixed the bug, and=
it should make its way onto SourceForge in the next day or so. </DIV><DIV>=
</DIV><DIV>Jim </DIV><DIV> </DIV><DIV>ThoughtWorks <BR></DIV><FONT color=
=3D#990099></FONT></FONT></BLOCKQUOTE><BR></blockquote><br></FONT>=
|
|
From: Owen R. <OR...@th...> - 2004-12-17 04:12:28
|
thanks jim. once you submit this, i think that we should package up a new release. cheers, owen. --- R. Owen Rogers ThoughtWorks Technologies (India) Pvt Ltd. ThoughtWorks - Deliver with passion! ThoughtWorks is always looking for talented people who are passionate about technology. To find out more about a career at ThoughtWorks go to http://www.thoughtworks.com/career/. Jim Arnold <JA...@th...> Sent by: nmo...@li... 17/12/2004 00:27 To: in...@ro... cc: nmo...@li..., (bcc: Owen Rogers/Canada/ThoughtWorks) Subject: Re: [Nmock-general] Problem with 'ref string[]' parameter Yes, there is a bug, but I'm a little confused by your test. NMock will only verify the value of a parameter, not the actual reference. In your test, you assign the variable 'refStringArr' to null, then pass it to your mock. This will fail (assuming the bug has been fixed) because NMock is expecting the original value assigned to strArr, which was {"a", "b"}. Even if NMock could have compared the reference refStringArr with strArr, however, it still would have failed, because they are different references. So I'm not sure what you expect the behavior to be. Anyway, I have fixed the bug, and it should make its way onto SourceForge in the next day or so. Jim ThoughtWorks -----nmo...@li... wrote: ----- To: nmo...@li... From: "web11p1" <in...@ro...> Sent by: nmo...@li... Date: 12/16/2004 05:19PM Subject: [Nmock-general] Problem with 'ref string[]' parameter Hello I've got a problem with creating a DynmicMock for a Interface with a Function that takes a 'ref string[] foo' parameter. (see example below). The function is defined as bool ByRefFunction(ref string[] strArray); the problem is that the ExpectAndReturn function of nMock didn't find the method signature (so it tells in the exception). Since some messages on the list archives showed a equal problem, i've got the latest nmock.dll from http://ccnetlive.thoughtworks.com/NMock-builds/131/ (was mentoind in a list message). Please find a example below! The ByRefFunction is suposed to cange to given array to { "a", "b" }, so the nunit tests should conform. Did i miss something or is it a bug? kind regards Dominik using System; using NUnit.Framework; using NMock; namespace Test { public interface IFoo { bool ByRefFunction(ref string[] strArray); bool Function(string[] strArray); } [TestFixture] public class FooTester { [Test] public void TestFunction() { string[] strArr = new string[] {"a", "b"}; Mock fooMock = new DynamicMock(typeof(IFoo)); fooMock.ExpectAndReturn("Function", true, (object)strArr); IFoo foo = (IFoo)fooMock.MockInstance; bool bar = foo.Function(strArr); Assert.IsTrue(bar); fooMock.Verify(); } [Test] public void TestByRefFunction() { string[] strArr = new string[] { "a", "b"}; Mock fooMock = new DynamicMock(typeof(IFoo)); fooMock.ExpectAndReturn("ByRefFunction", true, (object)strArr); string[] refStringArr = null; IFoo foo = (IFoo)fooMock.MockInstance; bool bar = foo.ByRefFunction(ref refStringArr); Assert.AreEqual("a", refStringArr[0]); Assert.AreEqual("b", refStringArr[1]); Assert.IsTrue(bar); fooMock.Verify(); } } } ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Nmock-general mailing list Nmo...@li... https://lists.sourceforge.net/lists/listinfo/nmock-general ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Nmock-general mailing list Nmo...@li... https://lists.sourceforge.net/lists/listinfo/nmock-general |
|
From: Dominik F. <li...@ro...> - 2004-12-16 23:10:23
|
Hi Jim
Thank you for your fast answer & bug fix!
Probably my test is a bit too constructed to display the miss behaivior ...
The concrete problem was in a existing project of mine.
There is a given library with a more or less simple behavior, Its a
database abstraction lib.
There are structs for the rows of a table, and a function to fill a
array of this structs for a select statement.
The function, as example 'GetJobsForCustomer' looks like this:
public bool GetJobsForCustomer(int customerId, ref JobRow[] rows)
Call the function, i have to create a new, but null assinged JobRow
array, and pass this by reference.
If the function returned true, it successed, and my rows array contains
all the JobsRow's for the customer.
It tried to create a DynamicMock for this behavior ... but it seams that
this is a bit out of the probabbilities
of nmock. I think i have to implement a mock by myself.
But thank you for fixing the bug so fast!
and sorry for the 'mail-adress-mess', i posted the first massage over a
webmail that was not successfully configured.
Greethings
Dominik
Jim Arnold wrote:
> Yes, there is a bug, but I'm a little confused by your test. NMock
> will only verify the value of a parameter, not the actual reference.
> In your test, you assign the variable 'refStringArr' to null, then
> pass it to your mock. This will fail (assuming the bug has been
> fixed) because NMock is expecting the original value assigned to
> strArr, which was {"a", "b"}. Even if NMock could have compared the
> reference refStringArr with strArr, however, it still would have
> failed, because they are different references. So I'm not sure what
> you expect the behavior to be.
>
> Anyway, I have fixed the bug, and it should make its way onto
> SourceForge in the next day or so.
>
> Jim
>
> ThoughtWorks
|
|
From: Jim A. <JA...@th...> - 2004-12-16 18:55:31
|
<FONT face=3D"Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=
=3D2><DIV>Yes, there is a bug, but I'm a little confused by your test. =
; NMock will only verify the value of a parameter, not the actual refe=
rence. In your test, you assign the variable 'refStringArr' to null, =
then pass it to your mock. This will fail (assuming the bug has been =
fixed) because NMock is expecting the original value assigned to strArr, wh=
ich was {"a", "b"}. Even if NMock could have compared the reference r=
efStringArr with strArr, however, it still would have failed, because they =
are different references. So I'm not sure what you expect the behavio=
r to be.</DIV><DIV> </DIV><DIV>Anyway, I have fixed the bug, and it sh=
ould make its way onto SourceForge in the next day or so.</DIV><DIV> <=
/DIV><DIV>Jim</DIV><DIV> </DIV><DIV>ThoughtWorks<BR></DIV><FONT color=
=3D#990099>-----nmo...@li... wrote: -----<BR><=
BR></FONT><blockquote style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGI=
N-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">To: nmock-g=
en...@li...<BR>From: "web11p1" <in...@ro...><BR>S=
ent by: nmo...@li...<BR>Date: 12/16/2004 05:19=
PM<BR>Subject: [Nmock-general] Problem with 'ref string[]' parameter<BR><BR=
><FONT face=3Dmonospace size=3D2>Hello<BR><BR>I've got a problem with creat=
ing a DynmicMock for a Interface with<BR>a Function that takes a 'ref strin=
g[] foo' parameter. (see example below).<BR><BR>The function is defined as =
<BR>bool ByRefFunction(ref string[] strArray);<BR><BR>the problem is that t=
he ExpectAndReturn function of nMock didn't find the <BR>method signature (=
so it tells in the exception).<BR><BR>Since some messages on the list archi=
ves showed a equal problem, i've got<BR>the latest nmock.dll from <A href=
=3D"http://ccnetlive.thoughtworks.com/NMock-builds/131/" target=3Dblank >h=
ttp://ccnetlive.thoughtworks.com/NMock-builds/131/</A><BR>(was mentoind in =
a list message).<BR><BR>Please find a example below!<BR><BR>The ByRefFuncti=
on is suposed to cange to given array to { "a", "b" }, so the<BR>nunit test=
s should conform.<BR><BR>Did i miss something or is it a bug?<BR><BR>kind r=
egards<BR>Dominik<BR><BR><BR><BR><BR><BR>using System;<BR>using NUnit.Frame=
work;<BR>using NMock;<BR>namespace Test<BR>{<BR><SPAN style=3D"VISIBILITY: =
hidden"> </SPAN>public interface IFoo<BR><SPAN style=
=3D"VISIBILITY: hidden"> </SPAN>{<BR><SPAN style=3D"=
VISIBILITY: hidden"> </SPAN><SPAN style=3D"VISIBILIT=
Y: hidden"> </SPAN>bool ByRefFunction(ref string[] s=
trArray);<BR><SPAN style=3D"VISIBILITY: hidden"> </S=
PAN><SPAN style=3D"VISIBILITY: hidden"> </SPAN>bool =
Function(string[] strArray);<BR><SPAN style=3D"VISIBILITY: hidden"> &n=
bsp; </SPAN>}<BR><BR><SPAN style=3D"VISIBILITY: hidden"> &n=
bsp; </SPAN>[TestFixture]<BR><SPAN style=3D"VISIBILITY: hidden">=
</SPAN>public class FooTester<BR><SPAN style=3D"VIS=
IBILITY: hidden"> </SPAN>{<BR><BR><SPAN style=3D"VIS=
IBILITY: hidden"> </SPAN><SPAN style=3D"VISIBILITY: =
hidden"> </SPAN>[Test]<BR><SPAN style=3D"VISIBILITY:=
hidden"> </SPAN><SPAN style=3D"VISIBILITY: hidden">=
</SPAN>public void TestFunction()<BR><SPAN style=3D=
"VISIBILITY: hidden"> </SPAN><SPAN style=3D"VISIBILI=
TY: hidden"> </SPAN>{<BR><SPAN style=3D"VISIBILITY: =
hidden"> </SPAN><SPAN style=3D"VISIBILITY: hidden">&=
nbsp; </SPAN><SPAN style=3D"VISIBILITY: hidden"> &nbs=
p; </SPAN>string[] strArr =3D new string[] {"a", "b"};<BR><SPAN =
style=3D"VISIBILITY: hidden"> </SPAN><SPAN style=3D"=
VISIBILITY: hidden"> </SPAN><SPAN style=3D"VISIBILIT=
Y: hidden"> </SPAN>Mock fooMock =3D new DynamicMock(=
typeof(IFoo));<BR><BR><SPAN style=3D"VISIBILITY: hidden"> =
</SPAN><SPAN style=3D"VISIBILITY: hidden"> </S=
PAN><SPAN style=3D"VISIBILITY: hidden"> </SPAN>fooMo=
ck.ExpectAndReturn("Function", true, (object)strArr);<BR><BR><SPAN style=3D=
"VISIBILITY: hidden"> </SPAN><SPAN style=3D"VISIBILI=
TY: hidden"> </SPAN><SPAN style=3D"VISIBILITY: hidde=
n"> </SPAN>IFoo foo =3D (IFoo)fooMock.MockInstance=
;<BR><SPAN style=3D"VISIBILITY: hidden"> </SPAN><SPA=
N style=3D"VISIBILITY: hidden"> </SPAN><SPAN style=
=3D"VISIBILITY: hidden"> </SPAN>bool bar =3D foo.F=
unction(strArr);<BR><BR><SPAN style=3D"VISIBILITY: hidden"> &nbs=
p; </SPAN><SPAN style=3D"VISIBILITY: hidden"> <=
/SPAN><SPAN style=3D"VISIBILITY: hidden"> </SPAN>Ass=
ert.IsTrue(bar);<BR><BR><SPAN style=3D"VISIBILITY: hidden"> &nbs=
p; </SPAN><SPAN style=3D"VISIBILITY: hidden"> <=
/SPAN><SPAN style=3D"VISIBILITY: hidden"> </SPAN>foo=
Mock.Verify();<BR><SPAN style=3D"VISIBILITY: hidden"> &nbs=
p;</SPAN><SPAN style=3D"VISIBILITY: hidden"> </SPAN>=
}<BR><BR><SPAN style=3D"VISIBILITY: hidden"> </SPAN>=
<SPAN style=3D"VISIBILITY: hidden"> </SPAN>[Test]<BR=
><SPAN style=3D"VISIBILITY: hidden"> </SPAN><SPAN st=
yle=3D"VISIBILITY: hidden"> </SPAN>public void TestB=
yRefFunction()<BR><SPAN style=3D"VISIBILITY: hidden"> &nbs=
p;</SPAN><SPAN style=3D"VISIBILITY: hidden"> </SPAN>=
{<BR><SPAN style=3D"VISIBILITY: hidden"> </SPAN><SPA=
N style=3D"VISIBILITY: hidden"> </SPAN><SPAN style=
=3D"VISIBILITY: hidden"> </SPAN>string[] strArr =3D =
new string[] { "a", "b"};<BR><SPAN style=3D"VISIBILITY: hidden">  =
; </SPAN><SPAN style=3D"VISIBILITY: hidden"> &n=
bsp;</SPAN><SPAN style=3D"VISIBILITY: hidden"> </SPA=
N>Mock fooMock =3D new DynamicMock(typeof(IFoo));<BR><BR><SPAN style=3D"VIS=
IBILITY: hidden"> </SPAN><SPAN style=3D"VISIBILITY: =
hidden"> </SPAN><SPAN style=3D"VISIBILITY: hidden">&=
nbsp; </SPAN>fooMock.ExpectAndReturn("ByRefFunction", true=
, (object)strArr);<BR><BR><SPAN style=3D"VISIBILITY: hidden"> &n=
bsp; </SPAN><SPAN style=3D"VISIBILITY: hidden">  =
;</SPAN><SPAN style=3D"VISIBILITY: hidden"> </SPAN>s=
tring[] refStringArr =3D null;<BR><BR><SPAN style=3D"VISIBILITY: hidden">=
</SPAN><SPAN style=3D"VISIBILITY: hidden"> &nb=
sp; </SPAN><SPAN style=3D"VISIBILITY: hidden"> =
</SPAN>IFoo foo =3D (IFoo)fooMock.MockInstance;<BR><SPAN style=3D"V=
ISIBILITY: hidden"> </SPAN><SPAN style=3D"VISIBILITY=
: hidden"> </SPAN><SPAN style=3D"VISIBILITY: hidden"=
> </SPAN>bool bar =3D foo.ByRefFunction(ref refStr=
ingArr);<BR><BR><SPAN style=3D"VISIBILITY: hidden"> =
</SPAN><SPAN style=3D"VISIBILITY: hidden"> </SPAN><S=
PAN style=3D"VISIBILITY: hidden"> </SPAN>Assert.AreE=
qual("a", refStringArr[0]);<BR><SPAN style=3D"VISIBILITY: hidden"> &nb=
sp; </SPAN><SPAN style=3D"VISIBILITY: hidden"> =
</SPAN><SPAN style=3D"VISIBILITY: hidden"> </S=
PAN>Assert.AreEqual("b", refStringArr[1]);<BR><SPAN style=3D"VISIBILITY: hi=
dden"> </SPAN><SPAN style=3D"VISIBILITY: hidden">&nb=
sp; </SPAN><SPAN style=3D"VISIBILITY: hidden"> =
</SPAN>Assert.IsTrue(bar);<BR><BR><SPAN style=3D"VISIBILITY: hi=
dden"> </SPAN><SPAN style=3D"VISIBILITY: hidden">&nb=
sp; </SPAN><SPAN style=3D"VISIBILITY: hidden"> =
</SPAN>fooMock.Verify();<BR><SPAN style=3D"VISIBILITY: hidden">=
</SPAN><SPAN style=3D"VISIBILITY: hidden"> &nb=
sp; </SPAN>}<BR><BR><SPAN style=3D"VISIBILITY: hidden"> &nb=
sp; </SPAN>}<BR><BR>}<BR><BR><BR><BR>---------------------------=
----------------------------<BR>SF email is sponsored by - The IT Product G=
uide<BR>Read honest & candid reviews on hundreds of IT Products from re=
al users.<BR>Discover which products truly live up to the hype. Start readi=
ng now. <BR><A href=3D"http://productguide.itmanagersjournal.com/" target=
=3Dblank >http://productguide.itmanagersjournal.com/</A><BR>=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F<BR>Nmock-general mai=
ling list<BR>Nmo...@li...<BR><A href=3D"https://list=
s.sourceforge.net/lists/listinfo/nmock-general" target=3Dblank >https://lis=
ts.sourceforge.net/lists/listinfo/nmock-general</A><BR></FONT></blockquote>=
<br></FONT>=
|
|
From: web11p1 <in...@ro...> - 2004-12-16 17:18:53
|
Hello I've got a problem with creating a DynmicMock for a Interface with a Function that takes a 'ref string[] foo' parameter. (see example below). The function is defined as bool ByRefFunction(ref string[] strArray); the problem is that the ExpectAndReturn function of nMock didn't find the method signature (so it tells in the exception). Since some messages on the list archives showed a equal problem, i've got the latest nmock.dll from http://ccnetlive.thoughtworks.com/NMock-builds/131/ (was mentoind in a list message). Please find a example below! The ByRefFunction is suposed to cange to given array to { "a", "b" }, so the nunit tests should conform. Did i miss something or is it a bug? kind regards Dominik using System; using NUnit.Framework; using NMock; namespace Test { public interface IFoo { bool ByRefFunction(ref string[] strArray); bool Function(string[] strArray); } [TestFixture] public class FooTester { [Test] public void TestFunction() { string[] strArr = new string[] {"a", "b"}; Mock fooMock = new DynamicMock(typeof(IFoo)); fooMock.ExpectAndReturn("Function", true, (object)strArr); IFoo foo = (IFoo)fooMock.MockInstance; bool bar = foo.Function(strArr); Assert.IsTrue(bar); fooMock.Verify(); } [Test] public void TestByRefFunction() { string[] strArr = new string[] { "a", "b"}; Mock fooMock = new DynamicMock(typeof(IFoo)); fooMock.ExpectAndReturn("ByRefFunction", true, (object)strArr); string[] refStringArr = null; IFoo foo = (IFoo)fooMock.MockInstance; bool bar = foo.ByRefFunction(ref refStringArr); Assert.AreEqual("a", refStringArr[0]); Assert.AreEqual("b", refStringArr[1]); Assert.IsTrue(bar); fooMock.Verify(); } } } |
|
From: Owen R. <OR...@th...> - 2004-12-14 05:09:51
|
i should also point out that you can download the latest build of nmock from ccnetlive. - the project dashboard is here: http://ccnetlive.thoughtworks.com/ccnet/ - and the builds are here: http://ccnetlive.thoughtworks.com/NMock-builds cheers, owen. --- R. Owen Rogers ThoughtWorks Technologies (India) Pvt Ltd. ThoughtWorks - Deliver with passion! ThoughtWorks is always looking for talented people who are passionate about technology. To find out more about a career at ThoughtWorks go to http://www.thoughtworks.com/career/. Jim Arnold <JA...@th...> Sent by: nmo...@li... 08/12/2004 22:06 To: chr...@ho... cc: nmo...@li..., (bcc: Owen Rogers/Canada/ThoughtWorks) Subject: Re: [Nmock-general] ExecutionEngineException with overloaded methods in VB.NET I think VB.Net is a red herring. I think the real problem is the ByRef modifier on IFileCollection::Add. When you tried it with C#, did you add the same (ref) modifier? The ByRef problem has been fixed but not rolled into any release - you just need to download the latest snapshot from CVS on SourceForge. Jim ThoughtWorks -----nmo...@li... wrote: ----- To: nmo...@li... From: "Chris Bartlett" <chr...@ho...> Sent by: nmo...@li... Date: 12/08/2004 03:41PM Subject: [Nmock-general] ExecutionEngineException with overloaded methods in VB.NET When ever I use NMock with overloaded methods in VB.NET I receive an ExecutionEngineException exception. I have created a simple project to demonstrate the problem using a collection. Interfaces: Public Interface IFile ReadOnly Property FileName() As String End Interface Public Interface IFileCollection Inherits IList Overloads Sub Add(ByRef file As IFile) End Interface Factory class: Imports NMock Friend Class Factory Public Shared FileCollectionToReturn As Mock Public Shared FileToReturn As Mock Public Shared Sub Reset() FileCollectionToReturn = Nothing FileToReturn = Nothing End Sub Private Sub New() End Sub Public Shared Function GetFileCollection() As IFileCollection Return CType(FileCollectionToReturn.MockInstance, IFileCollection) End Function Public Shared Function GetFile() As IFile Return CType(FileToReturn.MockInstance, IFile) End Function End Class Class to test: Public Class Sample Public Sub DoStuff() Dim file As IFile = Factory.GetFile() Dim collection As IFileCollection = Factory.GetFileCollection() collection.Add(file) End Sub End Class Test: Imports NMock Imports NUnit.Framework _ Public Class SampleUnitTests _ Public Sub TestDoStuff() Factory.Reset() Dim collection As Mock = New DynamicMock(GetType(IFileCollection)) Factory.FileCollectionToReturn = collection Dim file As Mock = New DynamicMock(GetType(IFile)) Factory.FileToReturn = file collection.Expect("Add", file.MockInstance) Dim sampleClass As Sample = New Sample sampleClass.DoStuff() Collection.Verify() End Sub End Class If I do the same in C# it works as expected. Any help would be very appreciated. Regards, Chris. ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Nmock-general mailing list Nmo...@li... https://lists.sourceforge.net/lists/listinfo/nmock-general ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Nmock-general mailing list Nmo...@li... https://lists.sourceforge.net/lists/listinfo/nmock-general |
|
From: Jim A. <JA...@th...> - 2004-12-08 16:35:18
|
<FONT face=3D"Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size= =3D2><DIV>I think VB.Net is a red herring. I think the real problem i= s the ByRef modifier on IFileCollection::Add. When you tried it with = C#, did you add the same (ref) modifier?</DIV><DIV> </DIV><DIV>The ByR= ef problem has been fixed but not rolled into any release - you just n= eed to download the latest snapshot from CVS on SourceForge.</DIV><DIV>&nbs= p;</DIV><DIV>Jim</DIV><DIV> </DIV><DIV>ThoughtWorks<BR></DIV><FONT col= or=3D#990099>-----nmo...@li... wrote: -----<BR= ><BR></FONT><blockquote style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MAR= GIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">To: nmock= -ge...@li...<BR>From: "Chris Bartlett" <chris=5Fbartle= tt...@ho...><BR>Sent by: nmo...@li...<BR= >Date: 12/08/2004 03:41PM<BR>Subject: [Nmock-general] ExecutionEngineExcept= ion with overloaded methods in VB.NET<BR><BR><FONT face=3Dmonospace size=3D= 2>When ever I use NMock with overloaded methods in VB.NET I receive an <BR>= ExecutionEngineException exception.<BR><BR>I have created a simple project = to demonstrate the problem using a <BR>collection.<BR><BR><BR>Interfaces:<B= R><BR>Public Interface IFile<BR><BR> ReadOnly Property FileName() As S= tring<BR><BR>End Interface<BR><BR><BR>Public Interface IFileCollection<BR>&= nbsp;Inherits IList<BR><BR> Overloads Sub Add(ByRef file As IFile)<BR>= <BR>End Interface<BR><BR><BR>Factory class:<BR><BR>Imports NMock<BR><BR>Fri= end Class Factory<BR><BR> Public Shared FileCollectionToReturn As Mock= <BR> Public Shared FileToReturn As Mock<BR><BR> Public Shared Sub= Reset()<BR><BR> FileCollectionToReturn =3D Nothing<BR> &= nbsp;FileToReturn =3D Nothing<BR><BR> End Sub<BR><BR> Private Sub= New()<BR> End Sub<BR><BR> Public Shared Function GetFileCollecti= on() As IFileCollection<BR><BR> Return CType(FileCollectionToRe= turn.MockInstance, IFileCollection)<BR><BR> End Function<BR><BR> = Public Shared Function GetFile() As IFile<BR><BR> Return CType(= FileToReturn.MockInstance, IFile)<BR><BR> End Function<BR><BR>End Clas= s<BR><BR><BR>Class to test:<BR><BR>Public Class Sample<BR><BR> Public = Sub DoStuff()<BR><BR> Dim file As IFile =3D Factory.GetFile()<B= R><BR> Dim collection As IFileCollection =3D Factory.GetFi= leCollection()<BR><BR> collection.Add(file)<BR><BR> End Su= b<BR><BR>End Class<BR><BR><BR>Test:<BR><BR>Imports NMock<BR>Imports NUnit.F= ramework<BR><BR><TESTFIXTURE()>=5F<BR>Public Class SampleUnitTests<BR><BR>&= nbsp;<TEST()> =5F<BR> Public Sub TestDoStuff()<BR><BR> &n= bsp;Factory.Reset()<BR><BR> Dim collection As Mock =3D New Dyna= micMock(GetType(IFileCollection))<BR> Factory.FileCollectionToR= eturn =3D collection<BR><BR> Dim file As Mock =3D New Dynamic= Mock(GetType(IFile))<BR> Factory.FileToReturn =3D file<BR><BR>&= nbsp; collection.Expect("Add", file.MockInstance)<BR><BR>  = ;Dim sampleClass As Sample =3D New Sample<BR><BR> sampleClass.D= oStuff()<BR><BR> Collection.Verify()<BR><BR> End Sub<BR><B= R>End Class<BR><BR><BR>If I do the same in C# it works as expected.<BR><BR>= Any help would be very appreciated.<BR><BR>Regards,<BR><BR>Chris.<BR><BR><B= R><BR><BR>-------------------------------------------------------<BR>SF ema= il is sponsored by - The IT Product Guide<BR>Read honest & candid revie= ws on hundreds of IT Products from real users.<BR>Discover which products t= ruly live up to the hype. Start reading now. <BR><A href=3D"http://productg= uide.itmanagersjournal.com/" target=3Dblank >http://productguide.itmanager= sjournal.com/</A><BR>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F<BR>Nmock-general mailing list<BR>Nmo...@li...= ge.net<BR><A href=3D"https://lists.sourceforge.net/lists/listinfo/nmock-gen= eral" target=3Dblank >https://lists.sourceforge.net/lists/listinfo/nmock-ge= neral</A><BR></FONT></blockquote><br></FONT>= |
|
From: Chris B. <chr...@ho...> - 2004-12-08 15:42:58
|
When ever I use NMock with overloaded methods in VB.NET I receive an ExecutionEngineException exception. I have created a simple project to demonstrate the problem using a collection. Interfaces: Public Interface IFile ReadOnly Property FileName() As String End Interface Public Interface IFileCollection Inherits IList Overloads Sub Add(ByRef file As IFile) End Interface Factory class: Imports NMock Friend Class Factory Public Shared FileCollectionToReturn As Mock Public Shared FileToReturn As Mock Public Shared Sub Reset() FileCollectionToReturn = Nothing FileToReturn = Nothing End Sub Private Sub New() End Sub Public Shared Function GetFileCollection() As IFileCollection Return CType(FileCollectionToReturn.MockInstance, IFileCollection) End Function Public Shared Function GetFile() As IFile Return CType(FileToReturn.MockInstance, IFile) End Function End Class Class to test: Public Class Sample Public Sub DoStuff() Dim file As IFile = Factory.GetFile() Dim collection As IFileCollection = Factory.GetFileCollection() collection.Add(file) End Sub End Class Test: Imports NMock Imports NUnit.Framework <TestFixture()> _ Public Class SampleUnitTests <Test()> _ Public Sub TestDoStuff() Factory.Reset() Dim collection As Mock = New DynamicMock(GetType(IFileCollection)) Factory.FileCollectionToReturn = collection Dim file As Mock = New DynamicMock(GetType(IFile)) Factory.FileToReturn = file collection.Expect("Add", file.MockInstance) Dim sampleClass As Sample = New Sample sampleClass.DoStuff() Collection.Verify() End Sub End Class If I do the same in C# it works as expected. Any help would be very appreciated. Regards, Chris. |
|
From: Mike R. <mik...@gm...> - 2004-11-18 00:11:04
|
On Wed, 17 Nov 2004 14:38:52 -0600, Levi Khatskevitch <lkh...@th...> wrote: > > Mike Roberts <mik...@gm...> wrote on 11/17/2004 02:39:59 PM: > > Published builds should use a consistent key. > > I wonder why, is there another reason besides making binding redirection > possible what's the problem with using one-time keys for releases? (just > curious) Pretty much the above. A public key gives you an identity. I think its good practice. > Why not use delay signing, where the public key is widely available and can > be used for partial signing. <snip> > With delay signing scheme only the person publishing releases would need > (and have access to) the private key. Yes, but where you automatically publish *any* successful build (as is the case with people using Dev builds off CCNetLive), that person *is* the build server, so delayed signing makes no sense in this case. I should add I'm no expert at this stuff, all just my opinion. -- mike roberts | http://mikeroberts.thoughtworks.net/ | http://www.thoughtworks.com/ |
|
From: Levi K. <LKh...@th...> - 2004-11-17 20:37:45
|
Mike Roberts <mik...@gm...> wrote on 11/17/2004 02:39:59 PM: > Published builds should use a consistent key. I wonder why, is there another reason besides making binding redirection possible what's the problem with using one-time keys for releases? (just curious) > On Wed, 17 Nov 2004 14:26:44 +0530, Owen Rogers > <or...@th...> wrote: > > > > opening the private key makes assembly spoofing very simple > > true. but how concerned are we with spoofing? this is an open source > > project after all. the key is just a part of the source. > > Urrr, no. (Or it shouldn't be). Private keys should be stored *only* > on the build server in a (relatively) secure way. Developer builds > (i.e. non build-server builds) should use no key, or a 'use once' key. Why not use delay signing, where the public key is widely available and can be used for partial signing. Developers register partially signed assemblies for 'skip verification' using sn.exe and thus can use them. Then when it's time to release someone who keeps the private key (and has the final authority over releases) uses it to complete the signing process. > In fact its perfectly reasonable to expect your buildserver to have > one key as a machine-wide resource. This is a service we could setup > on CCNetLive, and could pass through the key location to the build > script as a CruiseControl.NET property. With delay signing scheme only the person publishing releases would need (and have access to) the private key. Regards, - Levi |
|
From: Mike R. <mik...@gm...> - 2004-11-17 19:40:24
|
On Wed, 17 Nov 2004 14:26:44 +0530, Owen Rogers <or...@th...> wrote: > > opening the private key makes assembly spoofing very simple > true. but how concerned are we with spoofing? this is an open source > project after all. the key is just a part of the source. Urrr, no. (Or it shouldn't be). Private keys should be stored *only* on the build server in a (relatively) secure way. Developer builds (i.e. non build-server builds) should use no key, or a 'use once' key. Published builds should use a consistent key. In fact its perfectly reasonable to expect your buildserver to have one key as a machine-wide resource. This is a service we could setup on CCNetLive, and could pass through the key location to the build script as a CruiseControl.NET property. Mike -- mike roberts | http://mikeroberts.thoughtworks.net/ | http://www.thoughtworks.com/ |
|
From: Levi K. <LKh...@th...> - 2004-11-17 15:57:59
|
Exactly, and correct call sequence enforcement in mocks can be very=20 ambiguous, sometimes tests don't care in what order overloads are called=20 but other times it makes sense to even enforce sequence of different=20 methods. For example you may need to ensure that file.Close() is called=20 after file file.Open(). But still since most people consider overloads to=20 be different methods I think resolving them by name only is a little=20 counterintuitive. Regards, - Levi Owen Rogers/Canada/ThoughtWorks 11/17/2004 03:59 AM To Levi Khatskevitch/US/ThoughtWorks@ThoughtWorks cc nmo...@li... Subject Re: [Nmock-general] MethodSignature and friends ok, i see what you mean. the key problem (as i guess you're aware) is=20 that nmock identifies expectations on the basis of method name -- it=20 doesn't take overloads into account when trying to match expectations. cheers, owen. --- R. Owen Rogers ThoughtWorks Technologies (India) Pvt Ltd. ThoughtWorks - Deliver with passion! ThoughtWorks is always looking for talented people who are passionate=20 about technology. To find out more about a career at ThoughtWorks go to=20 http://www.thoughtworks.com/career/. Levi Khatskevitch 17/11/2004 05:49 To: Owen Rogers/Canada/ThoughtWorks@ThoughtWorks cc: nmo...@li... Subject: Re: [Nmock-general] MethodSignature and friends Hi Owen, Here's an example, try adding this to MockTest class: [Test] public void CallOverloadedMethodsInDifferentOrder() { mock.Expect("myMethod", "foo"); mock.Expect("myMethod", 1); mock.Invoke("myMethod", 1); mock.Invoke("myMethod", "foo"); mock.Verify(); } This test fails with the latest code from CVS even though myMethod(string) = and myMethod(int) are deferent overloads and IMO shouldn't be subjected to = the same call sequence at least logically. Regards, - Levi Owen Rogers/Canada/ThoughtWorks@THOUGHTWORKS 11/12/2004 06:38 AM To Levi Khatskevitch <LKh...@th...>@THOUGHTWORKS=5FCOM cc Jim Arnold <JA...@th...>, nmo...@li... Subject Re: [Nmock-general] MethodSignature and friends > Recently I was thinking about resolving methods to the first expectation = in the call sequence where argument types match. This preserves the=20 flexibility but also supports overloading in a more consistent way. For=20 example:=20 AFAIK, this is how nmock is supposed to work. what problems are you=20 experiencing when you try to do this?=20 cheers,=20 owen.=20 --- R. Owen Rogers ThoughtWorks Technologies (India) Pvt Ltd. ThoughtWorks - Deliver with passion! ThoughtWorks is always looking for talented people who are passionate=20 about technology. To find out more about a career at ThoughtWorks go to=20 http://www.thoughtworks.com/career/.=20 Levi Khatskevitch <LKh...@th...>=20 Sent by: nmo...@li...=20 01/11/2004 21:47=20 =20 To: Jim Arnold <JA...@th...>=20 cc: nmo...@li..., (bcc: Owen=20 Rogers/Canada/ThoughtWorks)=20 Subject: Re: [Nmock-general] MethodSignature and friends I had the same idea a while ago, but how would you handle argument=20 constraints like NotNull() that do not specify the argument type? Losing=20 them will make expectations more verbose but on the other hand requiring=20 too precise expectations often results in unit tests that follow real code = too closely - a common problem with interaction base testing that I've=20 seen.=20 Recently I was thinking about resolving methods to the first expectation=20 in the call sequence where argument types match. This preserves the=20 flexibility but also supports overloading in a more consistent way. For=20 example:=20 mock.Expect("Foo", new IsAnything()); // expect either overload=20 mock.Expect("Foo", (int)1); // expect Foo(int) overload=20 mock.Expect("Foo", (double)1.2); // expect Foo(double) overload=20 mock.Invoke("Foo", 2); // ok, resolved to the first expectation=20 mock.Invoke("Foo", 1.0); // fail, resolves to the third expectation and=20 thus should be 1.2=20 Any thoughts on this?=20 Regards,=20 - Levi=20 Jim Arnold <JA...@th...>=20 Sent by: nmo...@li...=20 11/01/2004 08:41 AM=20 To nmo...@li...=20 cc Subject [Nmock-general] MethodSignature and friends The method resolution in NMock is really starting to annoy me :-) It=20 works for simple cases (find a method named "Foo" with a return type of=20 "Bar"), but complex scenarios with overloads and indexed properties are=20 still buggy. The fundamental problem is that the user is not forced to=20 specify the attributes necessary to find a method. SetupResult() can just = take a method name and a return value, which is really not enough to=20 resolve overloaded properties.=20 =20 We should just get rid of the whole MethodSignature thing and start using=20 real MethodInfos and PropertyInfos instead. It might make the public API=20 slightly more complex, but would close a whole class of bugs.=20 =20 Can I get a +/- 1 from anybody?=20 =20 Jim=20 ------------------------------------------------------- This SF.Net email=20 is sponsored by: Sybase ASE Linux Express Edition - download now for FREE=20 LinuxWorld Reader's Choice Award Winner for best database on Linux.=20 http://ads.osdn.com/?ad=5FidU88&alloc=5Fid=12065&op=3Dclick=20 =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F Nmock-ge= neral mailing list=20 Nmo...@li...=20 https://lists.sourceforge.net/lists/listinfo/nmock-general=20 |