c#

The wonders of Debugger.Launch()

1 minute read

Ever worked on a project that involved spawning new .NET processes? (as in, one [arbitrary] program launches another .NET executable) I’ve had to do this on ...

Unity3d - Threadpool Exceptions

2 minute read

A quickie, but something to be very wary of. I’ve been using Unity3d of late (I recommend it – it’s a very opinionated and sometimes quirky bit of software, ...

Multiple Mocks?

2 minute read

This post was in response to a post on the fragmental.tw blog (the comments aren’t working for me, so I thought I’d post it here) which I read via Roy Oshero...

Castle DynamicProxy2 quirks

3 minute read

I’ve been faffing around with Castle.DynamicProxy2 a bit lately and it’s a pretty interesting bit of kit. Castle Dynamic Proxy (CDP) allows you to dynamicall...

Data-driven testing tricks

3 minute read

It’s a fairly common occurrence - somebody wants to use NUnit’s data driven testing, but they want to vary either the action under test, or the expectation. ...

More readable data-driven tests

2 minute read

When the logic of a test method remains constant but the data varies, data-driven testing is a great tool. It allows you, the test author, to write compact c...

AutoMapper and Test Data Builders

2 minute read

I’ve recently been tinkering with WCF and, as many people already know, writing data transfer objects is a pain in the balls. Nobody likes writing repetitive...

Avoiding the file system

5 minute read

Going from experience and, as illustrated by Misko’s recent presentation, the more dependencies you have on your environment, the less trustworthy and mainta...

Understanding test doubles

4 minute read

There is a bewildering array of types of ‘mock’ object available to a tester. The canonical list of test doubles was probably coined by the venerable Martin ...

Invert logical statements to reduce nesting

2 minute read

As a test engineer, I spend a lot of my time reading -and making sense of- other people’s code. I find it interesting that logically equivalent, re-arranged ...

The big block method (binary search)

4 minute read

Have you ever been in this situation? You have thousands of tests in scores of assemblies. All of the tests pass. However, when you run the test suite a seco...

Testing gotchas - c# Weak References

3 minute read

If you ever have to test a class that uses a WeakReference, or even just have to use Weak References, be very careful. Numerous strange-looking things can oc...