For automated integration tests, you often have external dependencies that you need to start up before the test run, and teardown after the test run. If you’re firing up a stub service, deploying a database, or starting a bunch of NServiceBus hosts, that can be expensive. You don’t want to do it in the test setup, as it’ll make all the tests longer to run. Ideally you want to run the startup once before any test starts, and then run the teardown once after all tests have finished. Visual Studio doesn’t ......
It’s surprising how easily you can bring down a .NET app. We’ll be starting the new year with a bulk load of data into the system we’re building, and now we’re load testing and verifying everything gets processed as expected. We’re fortunate that we have a snapshot of the expected data load, which contains around 70,000 incoming messages. We rely heavily on a separate system providing static data to enrich each message and we want to be sure that system has data for all the entities we’ll be pushing ......
Sometimes you need to switch on behaviour in your code for short period that you want to ensure gets switched back off again afterwards. I had this recently with an app we were performance tuning. We found a hotspot with our EF code where we were adding a batch of entities to a collection. We were adding a few dozen new entities, with some new nested entities of their own, and it was running slowly, compared to the rest of the stack. There are two flags you can switch off in DbContext.Configuration ......
Code for accessing nested properties in lambda expressions of the type s => s.Address.Line1
Simple extension for resolving "My Music" and other special folder paths in WiX
Stubbing out SiteCore in ASP.NET MVC using HtmlHelper extension methods and Web config transforms
Type extension for checking interface implementation without strings
A modification to the jQuery validation plugin, to fix date formatting issues in Chrome
Helper method for checking unit testing that an exception is thrown, with the correct error message
Code snippet for centralizing lazy-loading logic