Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Add ShouldBeLike #103

lanwin opened this Issue · 8 comments

3 participants

Steve Wagner Richard Oliver Alexander Groß
Steve Wagner

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.

Richard Oliver


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!

Steve Wagner

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?

Richard Oliver

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...

Steve Wagner

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

Richard Oliver

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

Steve Wagner

Interesting. Did you send it as pull request?

Richard Oliver rho24 referenced this issue from a commit in rho24/machine.specifications
Richard Oliver rho24 Merge branch 'master' into ShouldBeLike
Implements issue #103
Richard Oliver rho24 referenced this issue

Should be like #108

Richard Oliver

Pull request attached. Any feedback welcome!

Alexander Groß

See #108

Alexander Groß agross closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.