Tag Archives: CSharp

Visual Studio Javascript AMD Unit Testing

Unit Testing AMD-Style Javascript In Visual Studio

I’m currently working on a new MVC 5 client/server project. This project is an SPA (single-page application), which means the amount of Javascript client code easily dominates the amount of C# server code. In order to keep all that Javascript manageable, I’ve been writing AMD-style (asynchronous module definition) Javascript for use with Require.js. Unfortunately, unit testing AMD-style Javascript in Visual Studio doesn’t get nearly as much attention as does unit testing C# code. But the growing body of javascript code with absolutely zero test coverage was beginning to concern me. I decided it was time to address the situation.
Continue reading


SharpZipLib Tar Header Checksum is Invalid

I had to write some code recently that opens a .tar.bz2 file, modifies the contents, and then repackages back into a .tar.bz2. The fun and games ended when I discovered this obscure showstopper: ICSharpCode.SharpZipLib.Tar.TarException: Header checksum is invalid.

The following is an account of how I got here and my thought process while solving the problem.
Continue reading

puzzle pieces

Refactoring C# Data Access Code

Don’t Repeat Yourself is a well-known Computer Science adage. Sometimes, however, it’s too convenient to just repeat some code now and deal with it later. But eventually that practice will cost you. Maintaining multiple copies of code becomes a nightmare when a bug needs to be fixed or new features need to be added. It’s especially bad when many people are working on the code and don’t realize other copies exist elsewhere. Ugh.
Continue reading