You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(17) |
Aug
(6) |
Sep
(13) |
Oct
|
Nov
(2) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
|
Feb
(99) |
Mar
(42) |
Apr
(8) |
May
(17) |
Jun
(1) |
Jul
(1) |
Aug
(6) |
Sep
|
Oct
|
Nov
(26) |
Dec
|
| 2007 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
(21) |
Jun
|
Jul
(2) |
Aug
(21) |
Sep
(20) |
Oct
(33) |
Nov
(26) |
Dec
|
| 2008 |
Jan
(45) |
Feb
(8) |
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
| 2009 |
Jan
|
Feb
(4) |
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
(1) |
Dec
|
|
From: Mike M. <mik...@gm...> - 2006-03-03 22:13:44
|
On 3/3/06, Thibaut Barr=E8re <thi...@gm...> wrote: > > afaik you can't define solution wide symbols. > > one trick could be to create a specific solution + projects configuration > for .Net 2.0 as described there: > http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3D113686&SiteID=3D1 > Thanks for the info. I'm not sure I'm a big fan of having dummy configurations in the solution just to set conditional compilation flags, but we might have to pick the lesser of two evils here. I've switched Nant to use the <csc> target and explicitly define NET11 or NET20 which should mean Cruise is properly building the two versions of the library. Not sure what this will mean for someone using an IDE -- I suspect they just won't see the .NET 2.0 generics stuff. Cheers, Mike. |
|
From: <thi...@gm...> - 2006-03-03 08:13:11
|
> So the question is, when building a solution, can I somehow add a conditional compilation symbol, similar to using the compiler direct? Hi Mike afaik you can't define solution wide symbols. one trick could be to create a specific solution + projects configuration for .Net 2.0 as described there: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3D113686&SiteID=3D1 hope this helps Thibaut |
|
From: Owen R. <exo...@gm...> - 2006-03-03 05:55:26
|
On 02/03/06, Mike Mason <mik...@gm...> wrote: > I've started logging feature requests in the SF tracker to try and get a > handle on all the stuff we think we'd like to do for a 2.0 release. > > http://sourceforge.net/tracker/?group_id=3D66591&atid=3D515020 > > God, that SF tracker is awful. *sigh* we should be able to set up an extra project for you on the public tw jira, if you would prefer. o. -- Owen Rogers | http://dotnetjunkies.com/weblog/exortech | CruiseControl.NET - http://ccnet.thoughtworks.com |
|
From: Mike M. <mik...@gm...> - 2006-03-02 20:06:03
|
(apologies if you get this twice, gmail seemed to, *gasp*, get stuck first time around) I'm trying to compile NMock 2 for both .NET 1.1 and 2.0. When compiling for 2.0 I want to include a few bits of code that add generics to Mockery, making it easier to obtain mocks. At the moment we're using the <solution> nant task to compile the code. If = I look at the <csc> task, I can add a "define" attribute to define conditiona= l compilation symbols. Trouble is I'm about to have to write a bunch of different <csc> fragments for compiling the code, the unit tests, and the acceptance tests. Seems like a lot of overhead when the <solution> task is almost doing what I want. So the question is, when building a solution, can I somehow add a conditional compilation symbol, similar to using the compiler direct? Cheers, Mike. |
|
From: Mike M. <mik...@gm...> - 2006-03-02 19:03:08
|
I'm trying to compile NMock 2 for both .NET 1.1 and 2.0. When compiling for 2.0 I want to include a few bits of code that add generics to Mockery, making it easier to obtain mocks. At the moment we're using the <solution> nant task to compile the code. If = I look at the <csc> task, I can add a "define" attribute to define conditiona= l compilation symbols. Trouble is I'm about to have to write a bunch of different <csc> fragments for compiling the code, the unit tests, and the acceptance tests. Seems like a lot of overhead when the <solution> task is almost doing what I want. So the question is, when building a solution, can I somehow add a conditional compilation symbol, similar to using the compiler direct? Cheers, Mike. |
|
From: Nat P. <nat...@gm...> - 2006-03-02 18:39:49
|
You can extend the NMock syntax in several places. 1) Just write a method in the test fixture class. Quick and easy, but you the syntax looks a little different from the other constraints and you can't share factory methods among tests. 2) Create your own Is class derived from NMock2.Is and add your own factory methods in there. --Nat. On 3/2/06, Mike Mason <mik...@gm...> wrote: > On 3/2/06, Nat Pryce <nat...@gm...> wrote: > > > The latter. In the final example you show the use of "new" in an > > expectation. We've tried to make that be considered bad style in > > jMock and always show using a factory function so that tests are > > expressive. It's not always caught on but more people use factory > > functions than not. > > > > The jMock docs have this page: > http://jmock.codehaus.org/custom-constraints.html > > At the end of the page they suggest making a factory method by extending = the > base TestCase class provided by jMock, but this isn't how NMock 2 works. = I'm > not sure how an end-user can add a syntactically nice looking factory > method. > > I'm sorry to be dim, I guess what I'm asking for is a code sample. > > Cheers, > Mike. > > > |
|
From: Mike M. <mik...@gm...> - 2006-03-02 18:36:22
|
On 3/2/06, Nat Pryce <nat...@gm...> wrote: > > The latter. In the final example you show the use of "new" in an > expectation. We've tried to make that be considered bad style in > jMock and always show using a factory function so that tests are > expressive. It's not always caught on but more people use factory > functions than not. > The jMock docs have this page: http://jmock.codehaus.org/custom-constraints.html At the end of the page they suggest making a factory method by extending th= e base TestCase class provided by jMock, but this isn't how NMock 2 works. I'= m not sure how an end-user can add a syntactically nice looking factory method. I'm sorry to be dim, I guess what I'm asking for is a code sample. Cheers, Mike. |
|
From: Nat P. <nat...@gm...> - 2006-03-02 17:46:58
|
The latter. In the final example you show the use of "new" in an expectation. We've tried to make that be considered bad style in jMock and always show using a factory function so that tests are expressive. It's not always caught on but more people use factory functions than not. --Nat. On 3/2/06, Mike Mason <mik...@gm...> wrote: > On 3/2/06, Nat Pryce <nat...@gm...> wrote: > > > Hi. Sorry I jumped the gun a bit here. The tutorials on the site are > fine. > > > > One suggestion: the tutorial should describe the idiom of creating > > factory methods for creating actions and matchers. Yes, you can do > > ...Will(new BlahBlahBlahAction()) but doing that makes tests hard to > > read. The whole point of jMock and NMock2 is to provide a embedded > > domain-specific language that can be seamlessly extended by users, and > > this should be demonstrated at every opportunity in the tutorials and > > documentation. The end result -- clear tests/specifications -- is > > really worth it. > > > > Not 100% sure what you mean here -- do you not like the part where we > explain how the syntactic sugar used earlier corresponds to new BlahBlah(= ), > or would you like something added suggesting that if you make your own > custom matchers, you should also create factory methods for them? > > Cheers, > Mike. > |
|
From: Mike M. <mik...@gm...> - 2006-03-02 17:01:52
|
I've started logging feature requests in the SF tracker to try and get a handle on all the stuff we think we'd like to do for a 2.0 release. http://sourceforge.net/tracker/?group_id=3D66591&atid=3D515020 God, that SF tracker is awful. *sigh* Cheers, Mike. |
|
From: Mike M. <mik...@gm...> - 2006-03-02 16:58:46
|
On 3/2/06, Nat Pryce <nat...@gm...> wrote: > > Hi. Sorry I jumped the gun a bit here. The tutorials on the site are > fine. > > One suggestion: the tutorial should describe the idiom of creating > factory methods for creating actions and matchers. Yes, you can do > ...Will(new BlahBlahBlahAction()) but doing that makes tests hard to > read. The whole point of jMock and NMock2 is to provide a embedded > domain-specific language that can be seamlessly extended by users, and > this should be demonstrated at every opportunity in the tutorials and > documentation. The end result -- clear tests/specifications -- is > really worth it. > Not 100% sure what you mean here -- do you not like the part where we explain how the syntactic sugar used earlier corresponds to new BlahBlah(), or would you like something added suggesting that if you make your own custom matchers, you should also create factory methods for them? Cheers, Mike. |
|
From: Nat P. <nat...@gm...> - 2006-03-02 11:21:53
|
Hi. Sorry I jumped the gun a bit here. The tutorials on the site are fine= . One suggestion: the tutorial should describe the idiom of creating factory methods for creating actions and matchers. Yes, you can do ...Will(new BlahBlahBlahAction()) but doing that makes tests hard to read. The whole point of jMock and NMock2 is to provide a embedded domain-specific language that can be seamlessly extended by users, and this should be demonstrated at every opportunity in the tutorials and documentation. The end result -- clear tests/specifications -- is really worth it. --Nat On 3/2/06, Nat Pryce <nat...@gm...> wrote: > Mike, there are problems with that tutorial as I pointed out in the > comments. If you want tutorials for the nmock site, why not use the > custom constraints, matchers and actions tutorials from the jMock site > and convert the code to NMock2. I wrote those to address common > questions on the jMock mailing lists, and they've been improved > through feedback from users. Having common tutorials will also help > people transition from one framework to the other. > > I can put them under some Creative Commons license if you want. > > --Nat. > > > On 3/2/06, M. Scott Ford <va...@sc...> wrote: > > I am already there as M. Scott Ford. The posted address is my home > > address, and that is the one that I want to use. Just Scott Ford was my > > work address. I was unable to keep up with the list while at work using > > my personal account, so I subscribed from my work address. I hope that > > this did not confuse anyone. So, yeah, in short, I (M. Scott Ford) am > > me(Scott Ford). :) > > > > Mike Mason wrote: > > > > > That's great stuff Scott. I shall blatently steal that content for th= e > > > new NMock website. I'd like to add you to the "Team" page -- would yo= u > > > like to be "Scott Ford" or some other name, and would you like your > > > email address included (and if so, which one?). > > > > > > Cheers, > > > Mike. > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by xPML, a groundbreaking scripting lang= uage > > that extends applications into web and mobile media. Attend the live we= bcast > > and join the prime developer group breaking into this new coding territ= ory! > > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > > _______________________________________________ > > NMock-two-dev mailing list > > NMo...@li... > > https://lists.sourceforge.net/lists/listinfo/nmock-two-dev > > > |
|
From: Nat P. <nat...@gm...> - 2006-03-02 11:16:50
|
I agree that this should be part of the standard set of constraints.=20 Perhaps there should be constraints for dictionaries too. I merged a patch into jMock recently that contributed useful constraints for collections and dictionaries, so you can specify that a parameter is an element of a list, or is a key of a dictionary, etc. Very useful for keeping tests flexible. --Nat. On 3/2/06, Joe Poon <joe...@gm...> wrote: > i agree with mike on the definition of two lists being equal. > > as i imagine this is the most common definition, i'd find it convenient i= f a > built-in ListMatcher (perhaps like the one mike has in the tutorial) was = the > default matcher used by nmock2 when comparing two lists. and in the > scenario where order doesn't matter, bring on the custom matcher. > > - joe > > > On 3/1/06, Mike Mason <mik...@gm...> wrote: > > > > On 3/1/06, Joe Ross <joe...@gm... > wrote: > > > > > > > > > I'm not involved in the development of NMock2 obviously, but the > > > question I raise is whether or not everyone's definition of two lists > > > being equal is the same. My definition for my purpose was that each > > > list contained the same items in the same order. Someone else might > > > only care about the same items being in each list but not necessarily > > > the same order. I realize there is also a SortedList<T> in .NET 2.0, > > > but I want to use List<T> and add the objects in the correct order > > > based on business logic > > > > > > > > Well to me, if I'm using a List I would say I did care about order of > items. If I didn't care, I'd use a Set or a Bag. Problem is neither of th= ose > are built-in types for .NET (which is an entirely different rant ;-) ). > > > > I was just thinking that "check lists are not null, same size, and each > object in turn .Equals() the corresponding object in the other list" is a > piece of code most people are gonna end up writing, so maybe we should > provide it. > > Cheers, > > > > Mike. > > > > |
|
From: Nat P. <nat...@gm...> - 2006-03-02 11:13:47
|
Mike, there are problems with that tutorial as I pointed out in the comments. If you want tutorials for the nmock site, why not use the custom constraints, matchers and actions tutorials from the jMock site and convert the code to NMock2. I wrote those to address common questions on the jMock mailing lists, and they've been improved through feedback from users. Having common tutorials will also help people transition from one framework to the other. I can put them under some Creative Commons license if you want. --Nat. On 3/2/06, M. Scott Ford <va...@sc...> wrote: > I am already there as M. Scott Ford. The posted address is my home > address, and that is the one that I want to use. Just Scott Ford was my > work address. I was unable to keep up with the list while at work using > my personal account, so I subscribed from my work address. I hope that > this did not confuse anyone. So, yeah, in short, I (M. Scott Ford) am > me(Scott Ford). :) > > Mike Mason wrote: > > > That's great stuff Scott. I shall blatently steal that content for the > > new NMock website. I'd like to add you to the "Team" page -- would you > > like to be "Scott Ford" or some other name, and would you like your > > email address included (and if so, which one?). > > > > Cheers, > > Mike. > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting langua= ge > that extends applications into web and mobile media. Attend the live webc= ast > and join the prime developer group breaking into this new coding territor= y! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > _______________________________________________ > NMock-two-dev mailing list > NMo...@li... > https://lists.sourceforge.net/lists/listinfo/nmock-two-dev > |
|
From: M. S. F. <va...@sc...> - 2006-03-02 02:42:59
|
I am already there as M. Scott Ford. The posted address is my home address, and that is the one that I want to use. Just Scott Ford was my work address. I was unable to keep up with the list while at work using my personal account, so I subscribed from my work address. I hope that this did not confuse anyone. So, yeah, in short, I (M. Scott Ford) am me(Scott Ford). :) Mike Mason wrote: > That's great stuff Scott. I shall blatently steal that content for the > new NMock website. I'd like to add you to the "Team" page -- would you > like to be "Scott Ford" or some other name, and would you like your > email address included (and if so, which one?). > > Cheers, > Mike. |
|
From: Joe P. <joe...@gm...> - 2006-03-02 02:04:40
|
i agree with mike on the definition of two lists being equal. as i imagine this is the most common definition, i'd find it convenient if = a built-in ListMatcher (perhaps like the one mike has in the tutorial) was th= e default matcher used by nmock2 when comparing two lists. and in the scenario where order doesn't matter, bring on the custom matcher. - joe On 3/1/06, Mike Mason <mik...@gm...> wrote: > > On 3/1/06, Joe Ross <joe...@gm...> wrote: > > > I'm not involved in the development of NMock2 obviously, but the > > question I raise is whether or not everyone's definition of two lists > > being equal is the same. My definition for my purpose was that each > > list contained the same items in the same order. Someone else might > > only care about the same items being in each list but not necessarily > > the same order. I realize there is also a SortedList<T> in .NET 2.0, > > but I want to use List<T> and add the objects in the correct order > > based on business logic > > > Well to me, if I'm using a List I would say I did care about order of > items. If I didn't care, I'd use a Set or a Bag. Problem is neither of th= ose > are built-in types for .NET (which is an entirely different rant ;-) ). > > I was just thinking that "check lists are not null, same size, and each > object in turn .Equals() the corresponding object in the other list" is a > piece of code most people are gonna end up writing, so maybe we should > provide it. > > Cheers, > Mike. > |
|
From: Mike M. <mik...@gm...> - 2006-03-01 22:19:32
|
On 3/1/06, Joe Ross <joe...@gm...> wrote: > > I'm not involved in the development of NMock2 obviously, but the > question I raise is whether or not everyone's definition of two lists > being equal is the same. My definition for my purpose was that each > list contained the same items in the same order. Someone else might > only care about the same items being in each list but not necessarily > the same order. I realize there is also a SortedList<T> in .NET 2.0, > but I want to use List<T> and add the objects in the correct order > based on business logic Well to me, if I'm using a List I would say I did care about order of items= . If I didn't care, I'd use a Set or a Bag. Problem is neither of those are built-in types for .NET (which is an entirely different rant ;-) ). I was just thinking that "check lists are not null, same size, and each object in turn .Equals() the corresponding object in the other list" is a piece of code most people are gonna end up writing, so maybe we should provide it. Cheers, Mike. |
|
From: Mike M. <mik...@gm...> - 2006-03-01 22:16:08
|
I've pulled together the tutorial content and the stuff that Scott Ford and Joe Poon were working on (they actually both did some similar stuff with custom matchers and I have merged their contributions into the "Advanced" page -- thanks for the content guys!). http://the.earth.li/~mgm/nmock2/ As part of a serious push to releasing this I'd like feedback about what yo= u do/don't like about the site and any changes you'd like. In parallel I've started putting in issues for the code, which I'll talk about in a different thread to save cluttering this one. Cheers, Mike. |
|
From: Joe R. <joe...@gm...> - 2006-03-01 19:14:59
|
Mike-
I'm not involved in the development of NMock2 obviously, but the
question I raise is whether or not everyone's definition of two lists
being equal is the same. My definition for my purpose was that each
list contained the same items in the same order. Someone else might
only care about the same items being in each list but not necessarily
the same order. I realize there is also a SortedList<T> in .NET 2.0,
but I want to use List<T> and add the objects in the correct order
based on business logic
Are there other complexities to two lists being equal that I'm not
considering? My implementation was is simple as a null check, a count
check, then an object comparison across the lists.
-joe
On 3/1/06, Mike Mason <mik...@gm...> wrote:
> On 2/23/06, Nat Pryce <nat...@gm...> wrote:
> > You need to pass a custom matcher to the With method, since you want
> > to match on a single argument.
> >
> > E.g. create a EqualListsMatcher that checks if two lists are equal.
> > Write a convenient factory function to create it, then use it in an
> > expectation like:
> >
> >
> On(mock).Method("Foo").With(ListEqualTo(someList)).Will(Return.Value(10))=
;
> >
>
> We had the same problem on our projects and I created a ComparableList<T>
> class that overrode equals and did the right thing, but the matcher looks
> much more like it's the right thing to do.
>
> Is this something we should implement directly in NMock2 instead of
> requiring folks to implement their own ListEqualTo() matcher?
>
> Cheers,
> Mike.
>
|
|
From: Mike M. <mik...@gm...> - 2006-03-01 17:04:46
|
That's great stuff Scott. I shall blatently steal that content for the new NMock website. I'd like to add you to the "Team" page -- would you like to be "Scott Ford" or some other name, and would you like your email address included (and if so, which one?). Cheers, Mike. |
|
From: Mike M. <mik...@gm...> - 2006-03-01 16:54:40
|
On 2/23/06, Nat Pryce <nat...@gm...> wrote:
>
> You need to pass a custom matcher to the With method, since you want
> to match on a single argument.
>
> E.g. create a EqualListsMatcher that checks if two lists are equal.
> Write a convenient factory function to create it, then use it in an
> expectation like:
>
> On(mock).Method("Foo").With(ListEqualTo(someList)).Will(Return.Value
> (10));
>
We had the same problem on our projects and I created a ComparableList<T>
class that overrode equals and did the right thing, but the matcher looks
much more like it's the right thing to do.
Is this something we should implement directly in NMock2 instead of
requiring folks to implement their own ListEqualTo() matcher?
Cheers,
Mike.
|
|
From: Steve F. <st...@m3...> - 2006-02-24 08:12:47
|
Thanks. S. On 23 Feb 2006, at 19:48, <sco...@rk...> <sco...@rk...> wrote: > Hello, > > > > I have finished writing my blog post on custom matchers[1]. A post > on custom actions will be available soon. Since, I have been lazy, > and did not add a Creative Commons license to my blog, this email > grants the NMock project full rights to the text. > > > > [1]: http://vaderpi.scottandlaurie.com/blog/?p=307 > > > > Thanks, > > -Scott > > > |
|
From: <sco...@rk...> - 2006-02-23 19:49:06
|
Hello, =20 I have finished writing my blog post on custom matchers[1]. A post on custom actions will be available soon. Since, I have been lazy, and did not add a Creative Commons license to my blog, this email grants the NMock project full rights to the text.=20 =20 [1]: http://vaderpi.scottandlaurie.com/blog/?p=3D307 =20 Thanks, -Scott =20 |
|
From: Nat P. <nat...@gm...> - 2006-02-23 12:52:43
|
You need to pass a custom matcher to the With method, since you want
to match on a single argument.
E.g. create a EqualListsMatcher that checks if two lists are equal.=20
Write a convenient factory function to create it, then use it in an
expectation like:
On(mock).Method("Foo").With(ListEqualTo(someList)).Will(Return.Value(10=
));
--Nat.
On 2/22/06, Joe Ross <joe...@gm...> wrote:
> I believe you can disregard this question. Since sending the email
> I've discovered that I can pass a Matcher to the "To" method in
> addition to a value. This seems to accomplish what I'm after. I was
> trying to do .To (value).Matching (myMatcher) which I now know to be
> incorrect.
>
> If there's a better way to do this, I'd still like to hear any advice.
>
> Thanks!
> -joe
>
> On 2/22/06, Joe Ross <joe...@gm...> wrote:
> > I've done all of the due diligence I could think of before asking this
> > question. It seems obvious and I found some references to it on a
> > JMock forum but nothing with regards to NMock. I did most of my
> > searching with regards to ArrayLists as I figured there would be more
> > posts about .NET 1.x than 2.x.
> >
> > So anyway, the question is: I have an interface that exposes a
> > property of type List<T>. I've worked my way through the NMock2
> > source and discovered that when calling the setter, an
> > NMock2.Matchers.EqualMatcher is used to determine if the value passed
> > to the setter matches the expectation. EqualMatcher checks if it's an
> > array by using "is Array" (it is not technically an array) so then it
> > does an equals. At this point it's basically comparing the addresses
> > that each reference is pointing two. The addresses are different so
> > it fails.
> >
> > I need a more complex check than this for this collection. I thought
> > I could create a custom Matcher but it appears that the
> > ArgumentsMatcher is called before ExtraMatchersMatch. Is there a way
> > to override which ArgumentsMatcher is used?
> >
> > Again, I apologize if this question has been covered before. I
> > searched Google and this mailing list. I made my way through the
> > source code. I don't really know of a good source of NMock2
> > documentation (I have that cheat sheet PDF which is nice) besides the
> > source code and tests.
> >
> > Thanks for any assistance to an NMock2 newcomer,
> > -joe
> >
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmdlnk&kid=103432&bid#0486&dat=121642
> _______________________________________________
> NMock-two-dev mailing list
> NMo...@li...
> https://lists.sourceforge.net/lists/listinfo/nmock-two-dev
>
|
|
From: Joe R. <joe...@gm...> - 2006-02-22 18:28:37
|
I believe you can disregard this question. Since sending the email I've discovered that I can pass a Matcher to the "To" method in addition to a value. This seems to accomplish what I'm after. I was trying to do .To (value).Matching (myMatcher) which I now know to be incorrect. If there's a better way to do this, I'd still like to hear any advice. Thanks! -joe On 2/22/06, Joe Ross <joe...@gm...> wrote: > I've done all of the due diligence I could think of before asking this > question. It seems obvious and I found some references to it on a > JMock forum but nothing with regards to NMock. I did most of my > searching with regards to ArrayLists as I figured there would be more > posts about .NET 1.x than 2.x. > > So anyway, the question is: I have an interface that exposes a > property of type List<T>. I've worked my way through the NMock2 > source and discovered that when calling the setter, an > NMock2.Matchers.EqualMatcher is used to determine if the value passed > to the setter matches the expectation. EqualMatcher checks if it's an > array by using "is Array" (it is not technically an array) so then it > does an equals. At this point it's basically comparing the addresses > that each reference is pointing two. The addresses are different so > it fails. > > I need a more complex check than this for this collection. I thought > I could create a custom Matcher but it appears that the > ArgumentsMatcher is called before ExtraMatchersMatch. Is there a way > to override which ArgumentsMatcher is used? > > Again, I apologize if this question has been covered before. I > searched Google and this mailing list. I made my way through the > source code. I don't really know of a good source of NMock2 > documentation (I have that cheat sheet PDF which is nice) besides the > source code and tests. > > Thanks for any assistance to an NMock2 newcomer, > -joe > |
|
From: Joe R. <joe...@gm...> - 2006-02-22 17:47:14
|
I've done all of the due diligence I could think of before asking this question. It seems obvious and I found some references to it on a JMock forum but nothing with regards to NMock. I did most of my searching with regards to ArrayLists as I figured there would be more posts about .NET 1.x than 2.x. So anyway, the question is: I have an interface that exposes a property of type List<T>. I've worked my way through the NMock2 source and discovered that when calling the setter, an NMock2.Matchers.EqualMatcher is used to determine if the value passed to the setter matches the expectation. EqualMatcher checks if it's an array by using "is Array" (it is not technically an array) so then it does an equals. At this point it's basically comparing the addresses that each reference is pointing two. The addresses are different so it fails. I need a more complex check than this for this collection. I thought I could create a custom Matcher but it appears that the ArgumentsMatcher is called before ExtraMatchersMatch. Is there a way to override which ArgumentsMatcher is used? Again, I apologize if this question has been covered before. I searched Google and this mailing list. I made my way through the source code. I don't really know of a good source of NMock2 documentation (I have that cheat sheet PDF which is nice) besides the source code and tests. Thanks for any assistance to an NMock2 newcomer, -joe |