Getting started with Fake Objects – Part 3: Verify that a call has been made

If you haven’t read the other posts in this trilogy - you might what to have a look at them about now: Why fake is better then mock How to create a fake object Let’s begin the third part of this tutorial where I’ll explain what to do when we need to test that a … Continue reading Getting started with Fake Objects – Part 3: Verify that a call has been made

Getting started with Fake Objects – Part 2: How to create a fake object

In the previous post I’ve explained (briefly) what are fake objects and why they should be used – if you haven’t read it yet – I suggest you do so now. In  a nutshell fake objects are used to break dependencies in unit tests to make the test faster, predictable and enable you to test … Continue reading Getting started with Fake Objects – Part 2: How to create a fake object

Getting started with Fake Objects – Part 1: why fake is better then mock

If you’ve been writing unit tests for a short while you might have noticed that writing good unit tests is hard. The object under test can be hard to create because it require dependencies that you just cannot provide or some complicated environment is needed just to make the test pass. When writing a unit … Continue reading Getting started with Fake Objects – Part 1: why fake is better then mock

How to run NUnit tests created with VS2010 and .NET 4

Today when writing tests for a new project built using VS2010 I had an interesting problem: NUnit would not run my unit tests because the assembly that contained my unit tests was compiled using a newer version of the .NET runtime. There are several solutions to solve this issue from downgrading my project to use … Continue reading How to run NUnit tests created with VS2010 and .NET 4

Real world unit testing presentation

If you the Israel .NET Developers User Group (IDNDUG) and you’d like to learn more about unit testing you can view my presentation here. I talked about unit tests and how to write good unit tests in the first session. I had a lot of fun and I hope that so did my audience. http://docs.google.com/present/embed?id=dd3zxkh_192g6gkd4gc&interval=5Continue reading Real world unit testing presentation

How to unit test “un-testable” code (in a nutshell)

Not being able to unit test an essential scenario is one of the reasons developers stop unit testing their code. In fact most of the time when a team decides not to use TDD (Test Driven Development) is because it seems as if they won’t be able to test the production code using unit tests. … Continue reading How to unit test “un-testable” code (in a nutshell)