Category Archives: mocks

Rationalising mocked dependencies using concrete types

This really is amazingly obvious and simple, but for some reason it never occurred to me. The situation I’ve been getting myself into is that I have Business Logic actions that do a very discrete bit of logic, these will … Continue reading

Posted in dependency injection, development, IoC, mocks, MSTest, testing | Leave a comment

Strictly mocked operations rather than strictly mocked interfaces?

Recently I’ve been planning to contribute to the rhino mocks wiki. One of the topics I thought I would write about is when I would use the different types of mock (CreateMock, DynamicMock, Stub etc). To this end I was … Continue reading

Posted in alt.net, development, mocks, TDD, testing | Leave a comment

Using Rhino Mocks to test private methods on an abstract class

Firstly it is arguable that you should not be trying to directly test a private method on an abstract class, as tests should focus on the public methods, it should be upto the class where it uses private methods. However, … Continue reading

Posted in development, mocks, TDD, testing | Leave a comment

Should we use a mocking framework?

At the moment I’m tasked with investigating mocking frameworks. Currently we are using hand-written mocks/stubs, and I need to see what mocking frameworks are out there and what benefits they would bring. So far I’ve been focussing on Rhino Mocks … Continue reading

Posted in mocks, TDD, testing | 2 Comments

Mocks Aren’t Stubs

I’ve just read a really interesting article by Martin Fowler ‘Mocks Aren’t Stubs‘. This lead me to the conclusion that I have also been confusing the terms mocks and stubs. To try and summarise the key difference between mocks and … Continue reading

Posted in dependency injection, IoC, mocks, TDD, testing | Leave a comment

Mocking without a mocking framework

I have not yet had the opportunity to use a proper mocking framework. My project has a future investigation into them, but it’s a low priority. However we are using Test Driven Development, so we have started using mocks (with … Continue reading

Posted in dependency injection, development, IoC, methodology, mocks, TDD, techniques, testing | Leave a comment

How to handle dependency injection with nested dependencies

Recently I managed to get myself rather confused trying to use Test Driven Development to test a specific business logic class (Class A). Part of the business logic had been refactored into a seperate business logic class (Class B), this … Continue reading

Posted in dependency injection, development, IoC, methodology, mocks, TDD, testing | Leave a comment