ISerialized .Net, C#, Scrum and agile software development

23Mar/101

Running NUnit in an STA thread

Posted by Pål Eie

While unit testing a WPF Caliburn application, I bumped into the following error:

The calling thread must be STA

and I ended up with a cross-thread exception. When diving into this problem I found that TestDriver.Net actually runs in STA (acronym for Singel Thread Apartment) by default, but  NUnit is not! It is however a fairly simple configuration change to get NUnit running in STA.  Add or update your app.config in your test project with following:

11Mar/103

Converting from Blogger to WordPress

Posted by Pål Eie

This week I started the hard shift from my old Blogger blog to my new WordPress blog on my new domain ISerialized.com. There are a couple of aspects of such a shift that makes this a hard decision to do:
  • Allot of hard work
  • Leaving the old familiar Blogger tool
  • Learning WordPress
  • Trying to convert my old Feedburner readers to my new domain
  • Making the shift without too much traffic loss

Luckily most of my traffic are from referring sites, so I guess with a little work and a couple of emails, I could redirect much of the traffic over to ISerialized.com. Beyond the statistical facts, what are my lessons learned from these last couple of days?!

11Mar/105

How to unit test private methods in C# using NUnit

Posted by Pål Eie

Ever had the need to unit test a private method? Ever change a private method to public just to able to write a test for it? You are definitely not alone! A couple of weeks back I had a very interesting discussions with a very good colleague of mine: "What to do if I want to unit test a private method in C#". In this post I will show how you can use NUnit in combination with Reflection to unit test private methods!