Category Archives: Testing

Presentation Materials from TCCC9

If you attended my advanced Android presentation at the Twin Cities Code Camp 9, you can find the presentation located below. Advanced android View more presentations from donnfelker.

Materials from HDC09 – Testing With Mocks Talk

Below is a link to download the Testing With Mocks lightning round talk that I gave at the Heartland Developers Conference this last week. In order to get the samples to run you will need to have TypeMock Isolator installed. If you do not own a license you can download an evaluation for free here….

Twin Cities Dev. Guild – Testing With Mocks Materials

As promised, below you can download the presentation as well as code for the Testing with Mocks talk I gave this last Tuesday at the Twin Cities Developers Guild. Please note, in order to get the sample to build you will need to install TypeMock. They have evaluation you can download here. Download: TestingWithMocks_TCDG_20091013.zip (~15MB)…

Finding App_Data Programmatically

While writing some code I needed to be able to access the the App_Data directory in my ASPNET MVC app. Doing this usually involves a Server.MapPath, but this wont work for my unit test. Here’s how you can get around it:   var appDataPath = (string)AppDomain.CurrentDomain.GetData("DataDirectory") ?? AppDomain.CurrentDomain.SetupInformation.ApplicationBase;   Now I have my data directory…

Unit Testing JsonResult in MVC

Unit testing ActionResults is fairly easy yet JsonResults can pose a problem. I’ve seen a few ways to do this and they just seemed like “too much” to me. So here’s a way that I’ve devised that works very well. Its sort of has a “hack” feel to it, but it works perfectly. Controller Action:…