Category Archives: dependency injection

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

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