Thanks for your reply Alex.

However, the problem I have is that I have an object which has more
than one property and some of the properties are doubles.  This is why
I'd like to use the AllPropertiesMatch constraint.  I could just write
a customised checking routine, but that's not so nice, as currently I
can use the AllPropertiesMatch for *any* object which means it's easy
to write very generic tests.

If there were some way of specifying a delta for the
AllPropertiesMatch constraint to use if it came across a floating
point property that would be really helpful.  I don't know if there's
already some way to do this, or if not whether it could be added into
the next version of RhinoMocks?

Dominic


On Dec 1, 8:07 pm, Alex McMahon <[email protected]> wrote:
> The way I've normally done this sort of thing is with the arg<T>.matches():
>
> Arg<double>.Matches(p=>Math.Round(p,2)==testVal)
>
> 2009/12/1 dhearing1 <[email protected]>
>
> > Hi,
>
> > I'm using the AllPropertiesMatch constraint, but some of the objects I
> > am testing have Double properties, and I would like to supply a delta
> > so that the expected and actual values can be different as long their
> > difference is less than delta.  This allows for rounding errors.
>
> > Is there any way to do this?
>
> > Thanks,
>
> > Dominic
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Rhino.Mocks" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<rhinomocks%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/rhinomocks?hl=en.

--

You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en.


Reply via email to