MikeScott8 Programming Thoughts

My musings, ponderings, and other posts on programming. And maybe gadgets and other nerd stuff.

Rhino Mocks Basics and Link to Wiki

Leave a comment

I’ve been a user MOQ to mock objects for my unit testing over the years. I recently started on a project that is using Rhino Mocks (for certain layers, but that’s another topic entirely! haha).

I was able to get a bunch of simple tests done, but once I got to more advanced tests and started needing to have my “Expect” setups (and “AssertWasCalled” verification) to check what parameters were passed I ran into slight problems. I started looking online for how Rhino Mocks did it. I did a search and the first link I found (http://hibernatingrhinos.com/Oss/rhino-mocks/learn) was woefully light.

I did some more searching and found the following:

http://www.wrightfully.com/using-rhino-mocks-quick-guide-to-generating-mocks-and-stubs/

Which provided some good examples and links to other posts discussing Stub/Mock and other features. But one link was to another post by the same author about a discussion he had with a coworker about “VerifyAll” vs “AssertWasCalled” and that lead me to find the wiki for Rhino Mocks. And one section there was most of what I was looking for, how to check values on parameters to methods you setup for the test.

Rhino Mocks 3.5 wiki Constraints

I had not seen the this wiki in my search results. Wikis are not usually in my searching, so this post is mainly for me for future reference. And maybe someone will find this post someday and it will lead them to the wiki faster. At least that’s my hope.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s