Add ShouldBeLike #103

lanwin opened this Issue May 10, 2012 · 9 comments


None yet
4 participants

lanwin commented May 10, 2012

Simple example


This does not use Equals for check. Instead it checks each property with reflection. This way its very easy to check multiple properties of an object without having an instance of that object before and without having to impl Equals for each object.

rho24 commented May 11, 2012


I've had a go at an implementation. Couldn't figure out how to link to the commit properly so any tips would be handy!

lanwin commented May 31, 2012

Nice! Ive totally overlooked your comment.

I have build some prototype code to make a comparison of a complete object graph instead of only the local properties.

What do you think?

rho24 commented May 31, 2012

Looks good, i'll try and get round to merging it with my bits this weekend. Or if you want feel free to fork my branch and do it yourself.
Looking at this i'm wondering if it would be useful to test multiple depths e.g.
Address = new{
Line1 = "123 Fake Street",
Country = "UK"

But maybe that's over complicating things...

lanwin commented Jun 3, 2012

Hmm I dont think it will be over complicated and I want it exactly for this scenarios like this.

rho24 commented Jun 4, 2012

Updated implementation which now checks fields, arrays, and nested objects.

lanwin commented Jun 14, 2012

Interesting. Did you send it as pull request?

@rho24 rho24 added a commit to rho24/machine.specifications that referenced this issue Jun 16, 2012

@rho24 rho24 Merge branch 'master' into ShouldBeLike
Implements issue #103

rho24 referenced this issue Jun 16, 2012


Should be like #108

rho24 commented Jun 16, 2012

Pull request attached. Any feedback welcome!


agross commented Jun 29, 2012

See #108

agross closed this Jun 29, 2012

I wish I had seen this. I would have pointed you to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment