Geeks With Blogs

News This is the *old* blog. The new one is at
Elton Stoneman
This is the *old* blog. The new one is at
Code Snippet
How to setup and teardown integration test dependencies
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 ......

Posted On Wednesday, December 11, 2013 5:15 PM

Batching up memory-intensive parallel tasks
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 ......

Posted On Monday, December 9, 2013 4:44 PM

Using IDisposable to scope dangerous behaviour
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 ......

Posted On Friday, November 15, 2013 1:01 PM

Retrieving Nested Properties from Lambda Expressions

Code for accessing nested properties in lambda expressions of the type s => s.Address.Line1

Posted On Thursday, November 5, 2009 10:14 PM

Developing a SiteCore MVC site without SiteCore

Stubbing out SiteCore in ASP.NET MVC using HtmlHelper extension methods and Web config transforms

Posted On Tuesday, July 16, 2013 3:20 PM

Extension method for neatly checking a type implements an interface

Type extension for checking interface implementation without strings

Posted On Tuesday, October 4, 2011 10:00 AM

ExpectedException in MSTest does not check the exception message

Helper method for checking unit testing that an exception is thrown, with the correct error message

Posted On Friday, September 30, 2011 3:08 PM

jQuery Date Validation in Chrome

A modification to the jQuery validation plugin, to fix date formatting issues in Chrome

Posted On Thursday, October 29, 2009 2:20 PM

Resolving Special Folders in WiX 3.0

Simple extension for resolving "My Music" and other special folder paths in WiX

Posted On Tuesday, September 29, 2009 1:09 PM

Lazy-Loading with Object Extensions

Code snippet for centralizing lazy-loading logic

Posted On Wednesday, September 23, 2009 1:38 PM

Managing Concurrency over Service Boundaries

Sample WCF behaviors which enable concurrency management across service boundaries

Posted On Wednesday, April 15, 2009 11:15 PM

Making Logging Cheaper with Lambda Expressions

Using delegates and lambda expressions with lognet to minimise performance impact of logging calls

Posted On Wednesday, April 15, 2009 11:08 PM

Applying WCF Message Formatters Using Configuration

Applying IClientMessageFormatter and IDispatchMessageFormatter using configuration

Posted On Saturday, April 4, 2009 10:15 PM

Accessing Extended Data from IExtensibleDataObject

Reflecting over IExtsibleDataObject.ExtensionData

Posted On Friday, April 3, 2009 6:51 PM

Verify Long-Running Tests with Retrying Asserts

Retrying Asserts under a timeout for unit tests

Posted On Friday, October 31, 2008 8:47 PM

Creating Shortcuts in MSBuild

Using VBScript in MSBuild to generate shortcuts

Posted On Friday, October 24, 2008 7:13 PM

Deploying Pipeline Components in a CI Build

MSBuild snippet for deploying pipeline components so devenv can find them, without using the GAC

Posted On Friday, July 25, 2008 9:52 AM

Generating Deterministic GUIDs

Snippet for generating a deterministic GUID from a string

Posted On Thursday, June 26, 2008 2:38 PM

Copyright © Elton Stoneman | Powered by: