Copy + Pasting in Unit Tests

Some people love designing. Others love writing the code. While it’s true that some like testing and breaking software, I haven’t met a lot of people who enjoy writing unit tests. There’s something about them – getting 100% code coverage even though you know you’ll never encounter some situations, the repetitiveness of the set-up or…


UTF-8 strings in C#

I was doing a code review a few days ago on a web service library. There was a message which was supposed to be stored in UTF-8, since the service is internationalized. The code looked similarly to this: 1: string someRandomText; 2: UTF8Encoding encoder = new UTF8Encoding(); 3: byte[] bytes = Encoding.UTF8.GetBytes(someRandomText); 4: string utf8ReturnString…

3