Welcome to Typemock Answers. Here you can ask and receive answers from other community members. And if you liked or disliked an answer or thread: react with an up- or downvote Enjoy!

Arument Constrains

0 votes
As i said in a previous post your lib is the best (i hope some minor problems will be solved soon).

Anayway most people that have used other mock libs they know and have use extensively their argument predicates. It will be most usefull if u include on your library some of them like

IsEqual(object expected)--> Passes if expected.Equals(actual)
IsNull()-->Passes if actual is null
IsAnything()-->Always passes
IsTypeOf(Type type)-->Passes if actual is of a specific type
IsIn(param object[] list)-->Passes if actual is equal to any specified value

and so on...
i m sure u can find some usefull constrains to include

keep up the good work!!!
asked Jan 25, 2005 by tolisss (3,660 points)

4 Answers

0 votes
Hi,

Thanks for your input, we will see how to incorporate these in our next release.

Just to clear some things:
IsEqual(object expected)--> Passes if expected.Equals(actual)

This is the same as passing the expected object, why should you want to add the IsEqual()

IsNull()-->Passes if actual is null

This is the same as passing null, would you really want to add the IsNull()

IsAnything()-->Always passes

You can use MockManager.Any

IsTypeOf(Type type)-->Passes if actual is of a specific type
IsIn(param object[] list)-->Passes if actual is equal to any specified value

These are a good idea.
answered Jan 25, 2005 by richard (3,900 points)
0 votes
i just copy some of the basic constrains found in nmock.org most people start learning mocking with that library and it would be very could if u could include those constrains in your library. Have a look at the link there are some other insteresting constrain groups
answered Jan 25, 2005 by tolisss (3,660 points)
0 votes
Thanks for the pointer, we will look into it and add it to our Road Map.
answered Jan 25, 2005 by richard (3,900 points)
0 votes
Hi,
We strive to listen to our customers and this feature has been added in version 2.1.
Thank you for your ideas.
answered Feb 4, 2005 by richard (3,900 points)
...