We use Microsoft Fakes to isolate some legacy code. Today I added some tests that passed on my machine, but failed on the buildserver. 😦
After reading this stackoverflow post I added the
using(ShimsContext.Create()) { var fakeObject = new some.namespace.Fakes.LegacyObject(); fakeObject.BehaveAsDefaultValue(); // ... rest of test }
and the builds became green again 😉