MockObject

I just learned of the MockObject package in VisualWorks that lets you prove certain message sends take place in a test case. It will verify that the method gets called and that the arguments to it are correct. It will verify that the method’s return value is correct and with a small change you can make the method’s invocation signal an exception. OrderedMockObject makes sure that method sends happen in order. What a useful little bit of code! Thanks to Blaine Buxton for showing me this package.

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